Android 如何在SD卡中播放从服务器下载的视频

Android 如何在SD卡中播放从服务器下载的视频,android,video,android-intent,android-mediaplayer,Android,Video,Android Intent,Android Mediaplayer,我从服务器下载了一个文件,并将其保存在下载文件夹中 如何使用android的默认播放器和代码播放它 用肌动蛋白编码?像这样的代码 Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory() + "/download/" + "tarsnak.3gp")), "appl

我从服务器下载了一个文件,并将其保存在下载文件夹中

如何使用android的默认播放器和代码播放它

用肌动蛋白编码?像这样的代码

Intent intent = new Intent(Intent.ACTION_VIEW);
            intent.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory() + "/download/" + "tarsnak.3gp")), "application/vnd.android.package-archive");
            startActivity(intent);

您将“类型”设置错误。 使用以下代码

Intent i = new Intent(Intent.ACTION_VIEW);                      
i.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory() + "/download/" + "tarsnak.3gp")),"video/*");
startActivity(i);