am developing an application where I need to start the default music
app and play all the songs. I have tried a number of codes but nothing
seems to work.
Intent LaunchIntent =
getPackageManager().getLaunchIntentForPackage("com.android.music.MediaPlaybackActivityStarter");
startActivity( LaunchIntent );
and
Intent intent = new Intent();
ComponentName comp = new ComponentName("com.android.music",
"com.android.music.MediaPlaybackActivity");
intent.setComponent(comp);
intent.setAction(Intent.ACTION_RUN);
startActivity(intent);
just starts the music player, but do not play anything. And
Intent i = new Intent(Intent.ACTION_VIEW);
Uri u =
Uri.withAppendedPath(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
"1");
startActivity(i);
Plays just the first song.
I need to play all the songs. Somewhat like when you press the headset
button, and the music starts playing by default from last saved state,
but through code.
Please help.
Thanks in advance.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en