0

For a test, I've modified the AOSP "Music" app a little. In the manifest, I've made the following changes:

  1. Change package name from "com.android.music" to "com.android.mymusic"
  2. Change android:label from "Music" to "MyMusic" (for ease of identification)

On other apps, I've also had to make sure all class names in the manifest were fully qualified, but in "Music" they already were. This is enough that I can build, install, and get an icon in the app drawer. However, when I try to launch my customized music program (with either an intent, or by touching the launcher icon), I always get the "complete action using" dialogue. This is a problem because I need to launch it from another app, using an intent, and I can't allow user interaction. It seems especially strange to me that the launcher icon wouldn't just launch my customized app directly.

Why am I getting the "complete action using" dialogue, and how do I bypass it?

rainrunner
  • 118
  • 1
  • 9

1 Answers1

0

Try taking

android.intent.action.MUSIC_PLAYER"

out of your intent-filter for com.android.music.MusicBrowserActivity.

Phuong Nguyen
  • 909
  • 7
  • 20
  • Thank you, but I already tried removing that (and "android.intent.category.APP_MUSIC"). No luck. – rainrunner Jun 12 '13 at 23:44
  • sanity check, you completely removed the other music package right? – Phuong Nguyen Jun 12 '13 at 23:52
  • No, it's still there. With other apps (Browser, Email), the stock and my custom version can exist at the same time, and I don't have problems launching one or the other without the "complete action using" dialogue. For this test, I can't force the user to uninstall, disable, or even change default behavior for the existing apps. – rainrunner Jun 12 '13 at 23:58
  • Did you change the packagename of your activities to match your new app package name? com.android.music.MusicBrowserActivity -> com.android.mymusic.MusicBrowserActivity and so on – Phuong Nguyen Jun 13 '13 at 00:15
  • I did not, as that shouldn't be required (and wasn't in other apps). That would be a difficult change, but, if I can't figure out something else, I might have to try it. – rainrunner Jun 13 '13 at 12:54
  • When you send the direct intent, did you send it to specific package / class? – Phuong Nguyen Jun 13 '13 at 17:52
  • I've tried it 2 ways: 1. sending it directly to my package by creating an intent using "getPackageManager().getLaunchIntentForPackage("my.package.name") 2. creating a custom intent that (supposedly) only my modified app is registered for using "myIntent.setAction("my.package.name.my.intent" Both this (launching via intent from another app) and launching directly by clicking on the icon in the app drawer always results in the "complete action using" question. It seems that Android recognizes that this is a music app and intercepts the intent rather than sending it directly to my app. – rainrunner Jun 13 '13 at 20:50
  • Try. Intent i = new Intent(); i.setClassName("your.package", "your.package.youractivity"); startActivity(i); – Phuong Nguyen Jun 13 '13 at 20:55