title: Android play AMR file using default Music player
body: <p>I have few AMR file in my SD card. I want to play those amr files using default android music player.
  TODO this,i tried below code :</p>
  
  <pre><code>        Uri myUri = Uri.parse(Environment.getExternalStorageDirectory().getAbsolutePath() + "/myfiles/filename.amr");
      Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
      intent.setDataAndType(myUri, "audio/*");
      startActivity(intent);
  </code></pre>
  
  <p>and my stacktrace :</p>
  
  <p><code>07-16 15:23:47.284: D/Instrumentation(32496): checkStartActivityResult  :Intent { act=android.intent.action.VIEW dat=/storage/emulated/0/myfiles/filename.amr typ=audio/* }<br>
  07-16 15:23:47.284: D/Instrumentation(32496): checkStartActivityResult  inent is instance of inent:  07-16 15:23:47.284: D/AndroidRuntime(32496): Shutting down VM<br>
  07-16 15:23:47.284: W/dalvikvm(32496): threadid=1: thread exiting with uncaught exception (group=0x414feac8)<br>
  07-16 15:23:47.304: E/AndroidRuntime(32496): FATAL EXCEPTION: main<br>
  07-16 15:23:47.304: E/AndroidRuntime(32496): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW   dat=/storage/emulated/0/myfiles/filename.amr typ=audio/* }<br>
  07-16 15:23:47.304: E/AndroidRuntime(32496):    at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1659)<br>
  07-16 15:23:47.304: E/AndroidRuntime(32496):    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1434)<br>
  07-16 15:23:47.304: E/AndroidRuntime(32496):    at android.app.Activity.startActivityForResult(Activity.java:3430)<br>
  07-16 15:23:47.304: E/AndroidRuntime(32496):    at android.app.Activity.startActivityForResult(Activity.java:3391)<br>
  07-16 15:23:47.304: E/AndroidRuntime(32496):    at android.app.Activity.startActivity(Activity.java:3626)<br>
  07-16 15:23:47.304: E/AndroidRuntime(32496):    at android.app.Activity.startActivity(Activity.java:3594)
  07-16 15:23:47.304: E/AndroidRuntime(32496):    at com.example.ui.MainActivity.onItemClick(MainActivity.java:85)<br>
  07-16 15:23:47.304: E/AndroidRuntime(32496):    at android.widget.AdapterView.performItemClick(AdapterView.java:301)<br>
  07-16 15:23:47.304: E/AndroidRuntime(32496):    at android.widget.AbsListView.performItemClick(AbsListView.java:1502)<br>
  07-16 15:23:47.304: E/AndroidRuntime(32496):    at android.widget.AbsListView$PerformClick.run(AbsListView.java:3250)
  07-16 15:23:47.304: E/AndroidRuntime(32496):    at android.widget.AbsListView$1.run(AbsListView.java:4299) 
  07-16 15:23:47.304: E/AndroidRuntime(32496):    at android.os.Handler.handleCallback(Handler.java:725)    07-16 15:23:47.304: E/AndroidRuntime(32496):  at android.os.Handler.dispatchMessage(Handler.java:92)
  07-16 15:23:47.304: E/AndroidRuntime(32496):    at android.os.Looper.loop(Looper.java:137)
  07-16 15:23:47.304: E/AndroidRuntime(32496):    at android.app.ActivityThread.main(ActivityThread.java:5227)<br>
  07-16 15:23:47.304: E/AndroidRuntime(32496):    at java.lang.reflect.Method.invokeNative(Native Method)<br>
  07-16 15:23:47.304: E/AndroidRuntime(32496):    at java.lang.reflect.Method.invoke(Method.java:511) 
  07-16 15:23:47.304: E/AndroidRuntime(32496):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
  07-16 15:23:47.304: E/AndroidRuntime(32496):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869) 
  07-16 15:23:47.304: E/AndroidRuntime(32496):    at dalvik.system.NativeStart.main(Native Method)
  </code></p>
  
  <p>How can i achieve this ?
  When this amr is opened in file manager,it shows a dialog to choose music players available and started playing.Same thing i want to achieve.</p>
  
  <p><img src="https://i.stack.imgur.com/F9iie.png" alt="my target to achieve to get this pop up in my app "></p>