0
我讀這篇文章: Sending the User to Another App如何將用戶發送到Android中的視頻播放器?
如果用戶點擊一個按鈕,他們應該被髮送到視頻播放器觀看視頻,任何人都可以請告訴我,我應該放什麼意圖的構造?我有一個mp4文件的路徑爲String
。
我讀這篇文章: Sending the User to Another App如何將用戶發送到Android中的視頻播放器?
如果用戶點擊一個按鈕,他們應該被髮送到視頻播放器觀看視頻,任何人都可以請告訴我,我應該放什麼意圖的構造?我有一個mp4文件的路徑爲String
。
試試下面的代碼
File file=new File(filepath);
Uri uriToFile=Uri.fromFile(file);
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_STREAM, uriToFile);
shareIntent.setType("*/mp4");
startActivity(Intent.createChooser(shareIntent,"Send to"));
http://stackoverflow.com/a/5043858/1778834這可能會幫助你。 – yashhy