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