title: Start default music player with music playing by default
body: <p>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.</p>
  
  <pre class="lang-java prettyprint-override"><code>Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage(
                            "com.android.music.MediaPlaybackActivityStarter");
  startActivity( LaunchIntent );
  </code></pre>
  
  <p>and </p>
  
  <pre class="lang-java prettyprint-override"><code>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);
  </code></pre>
  
  <p>Just starts the music player</p>
  
  <pre class="lang-java prettyprint-override"><code>Intent i = new Intent(Intent.ACTION_VIEW);
  Uri u = Uri.withAppendedPath(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,  "1");
  startActivity(i);
  </code></pre>
  
  <p>Plays just the first song.</p>