1
如何从我的Android应用程序启动进程?我想要启动默认音乐播放器来播放选定的歌曲。我可以从我自己的应用程序中播放歌曲,但我想让默认播放器播放歌曲。我将如何去做这件事?用Android应用程序启动应用程序或文件
谢谢。这就是我用你的例子工作。
Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
Uri data = Uri.parse("file://" + pathtofile);
intent.setDataAndType(data,"audio/mp3");
try {
startActivity(intent);
} catch (ActivityNotFoundException e) {
e.printStackTrace();
}
的[推出的Android使用意向的音乐播放器]可能重复(http://stackoverflow.com/questions/3114471/android-launching-music-player-using-intent) – 2011-01-13 19:52:19