title: How to intent to system media application in android
body: <p><strong>How to intent to system media application?</strong></p>
  
  <p>Because I want to play the video in my application by using system media application.</p>
  
  <p>I trying the following code, but not successfully. </p>
  
  <pre><code>    url = "http://www.ooklnet.com/files/381/381489/video.mp4";
      Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
      intent.addCategory(Intent.CATEGORY_APP_MUSIC);
      startActivity(intent);
  </code></pre>
  
  <p>But when i trying the following code, it is successfull,</p>
  
  <pre><code>    url = "http://www.ooklnet.com/files/381/381489/video.mp4";
      Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
      startActivity(intent);
  </code></pre>
  
  <p>However, It needs me to open two steps:</p>
  
  <ul>
  <li><p>First step is show the dialog (Android System &amp; Browser) to choose.</p></li>
  <li><p>Second step : when I choose Android System, it shows the applications can play this video.</p></li>
  </ul>
  
  <p>I want to <strong>press "Play" button, it will run by using system media application</strong>,</p>
  
  <p>Please tell me how,</p>
  
  <p><strong>UPDATE</strong> after receive the answer from CommonWare :</p>
  
  <p>I can use the following code <strong>to intent exactly the system media app</strong> guy. </p>
  
  <pre><code>// String type = "audio/mpeg4-generic"; // It works for only Mobo Player
  String type = "video/mp4"; // It works for all video application
  
  Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
  intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
  intent.setDataAndType(Uri.parse(url), type);
  startActivity(intent);
  </code></pre>
  
  <p>My device has existed third media application <strong>(Mobo Player, MX Player and Video)</strong>, 
  The <strong>Video application is the system media app</strong>, so we can not uninstall it in the <strong>Settings</strong>.</p>
  
  <p>p/s : I use Android version 2.2.1,</p>
  
  <p>Thanks,</p>