Android Intent调用播放多媒体

亦凉 2023-06-19 02:18 159阅读 0赞

1,播放多媒体

  1. Intent intent = new Intent(Intent.ACTION_VIEW);
  2. Uri uri = Uri.parse("file:///sdcard/foo.mp3");
  3. intent.setDataAndType(uri, "audio/mp3");
  4. startActivity(intent);
  5. Uri uri = Uri.withAppendedPath(MediaStore.Audio.Media.INTERNAL_CONTENT_URI, "1");
  6. Intent intent = new Intent(Intent.ACTION_VIEW, uri);
  7. startActivity(intent);

更多Intent 使用详解:https://blog.csdn.net/cricket_7/category_9549721.html

发表评论

表情:
评论列表 (有 0 条评论,159人围观)

还没有评论,来说两句吧...

相关阅读