I am developing an application where I need to start the default music app and play all the songs. I have tried a number of approaches, 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
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.