问题描述
||
我有一个使用
ACTION_PICK
允许用户选择歌曲的应用程序。选中该歌曲后,应用程序将使用光标位置,并稍后再执行另一个意图以显示NOW_PLAYING
界面。在我在droid设备上安装Music Beta之前,该应用程序运行良好。然后应用程序以with2ѭ开始失败。目的和过滤器如下所示:
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType(\"vnd.android.cursor.dir/track\");
this.startActivity(intent);
我卸载了Music Bata,该应用程序再次正常运行。想看看这是否是与新的Google音乐应用程序有关的错误,并查看是否有人遇到此问题。
解决方法
检查MusicUtils.java。那里有一些接听歌的电话。他们都有:
intent.setDataAndType(Uri.EMPTY,\"vnd.android.cursor.dir/track\");
在另一个地方,我发现:
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,\"podcasts\");
startActivity(intent);
} else {
Intent intent = new Intent(Intent.ACTION_EDIT);
intent.setDataAndType(Uri.EMPTY,Long.valueOf(id).toString());
startActivity(intent);
}
在两个文件中,意图都通过Uri.EMPTY路由