1、调用系统音乐播放器
方法一;
Intent it = new Intent(Intent.ACTION_VIEW);
it.setDataAndType(Uri.parse(item.url), "audio/mp3");
it.setComponent(new ComponentName("com.android.music","com.android.music.MediaPlaybackActivity"));
2、调用系统视频播放器
方法一;
Intent it = new Intent(Intent.ACTION_VIEW);
it.setDataAndType(Uri.parse("/sdcard/test.mp4"), "video/mp4");
方法一;
Intent it = new Intent(Intent.ACTION_VIEW);
it.setDataAndType(Uri.parse(item.url), "audio/mp3");
it.setComponent(new ComponentName("com.android.music","com.android.music.MediaPlaybackActivity"));
startActivity(it);
方法二;
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("audio/*");
startActivity(Intent.createChooser(intent, "Select music"));
2、调用系统视频播放器
方法一;
Intent it = new Intent(Intent.ACTION_VIEW);
it.setDataAndType(Uri.parse("/sdcard/test.mp4"), "video/mp4");
startActivity(it);
方法二;
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("video/*");
startActivity(Intent.createChooser(intent, "Select music"));