[英]How to play 3gp video file with intent in android?
我想在Android平板電腦中播放.3gp視頻文件。 我嘗試下面的代碼,但它會引發錯誤消息。 如何在Android中使用默認視頻播放器播放?
String movieurl = root + "/" + fileNameTextView.getText().toString();
Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
Uri data = Uri.parse(movieurl);
intent.setDataAndType(data,"video/3gpp");
startActivity(intent);
這是錯誤消息:
11-15 13:47:11.060:E / AndroidRuntime(23061):android.content.ActivityNotFoundException:找不到用於處理Intent的活動{act = android.intent.action.VIEW dat = / mnt / sdcard / DCIM / Camera / VID_20121002_174209 .3gp typ = video / 3gpp}
我通過在開頭添加“ file:///”來更改了字符串movieurl:
String movieurl = "file:///" + root + "/" + fileNameTextView.getText().toString();
並且解決了這個問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.