0

I have an application that uses ACTION_PICK to allow the user to pick a song. Once that song is picked, the application uses the cursor location and does another intent later on to show the NOW_PLAYING interface. The application worked fine until I installed Music Beta on my droid device. The application then began failing with UnsupportedOperationException. The intent and filters looked like this:

Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("vnd.android.cursor.dir/track");
this.startActivity(intent);

I uninstalled Music Bata and the application again worked fine. Wanted to see if this was a bug related to new Google music application and see if anyone else was having this problem.

Kara
  • 6,115
  • 16
  • 50
  • 57
d_surround
  • 38
  • 3

1 Answers1

0

Check MusicUtils.java. In there there are some calls to pick a song. They all have:

intent.setDataAndType(Uri.EMPTY, "vnd.android.cursor.dir/track");

On another place I found:

if (id == RECENTLY_ADDED_PLAYLIST) {
    Intent intent = new Intent(Intent.ACTION_PICK);
    intent.setDataAndType(Uri.EMPTY, "vnd.android.cursor.dir/track");
    intent.putExtra("playlist", "recentlyadded");
    startActivity(intent);
} else if (id == PODCASTS_PLAYLIST) {
    Intent intent = new Intent(Intent.ACTION_PICK);
    intent.setDataAndType(Uri.EMPTY, "vnd.android.cursor.dir/track");
    intent.putExtra("playlist", "podcasts");
    startActivity(intent);
} else {
    Intent intent = new Intent(Intent.ACTION_EDIT);
    intent.setDataAndType(Uri.EMPTY, "vnd.android.cursor.dir/track");
    intent.putExtra("playlist", Long.valueOf(id).toString());
    startActivity(intent);
}

In both files the Intent is routed with Uri.EMPTY

Kamen
  • 3,575
  • 23
  • 35
  • Thanks Kamen. I changed my code using the empty Uri, reinstalled music bata and tested the app. It failed with same error code: 05-27 08:44:19.882: ERROR/AndroidRuntime(17762): FATAL EXCEPTION: main 05-27 08:44:19.882: ERROR/AndroidRuntime(17762): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.PICK dat= typ=vnd.android.cursor.dir/track } 05-27 08:44:19.882: ERROR/AndroidRuntime(17762): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1408) – d_surround May 27 '11 at 12:56
  • What's the log for the exception? – Kamen May 27 '11 at 12:58
  • That was a portion of the log, I can't post the entire log here for some reason...not enough character space....05-27 08:44:19.882: ERROR/AndroidRuntime(17762): FATAL EXCEPTION: main 05-27 08:44:19.882: ERROR/AndroidRuntime(17762): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.PICK dat= typ=vnd.android.cursor.dir/track } 05-27 08:44:19.882: ERROR/AndroidRuntime(17762): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1408) – d_surround May 28 '11 at 00:02
  • Doesn't seem good :) It really seems to be something causes by Music Beta. You'd better try to contact the Music team. Sorry... – Kamen May 28 '11 at 08:51