获取到地址后 调用系统的打开
private void playVideo(String path) {
Log.d(TAG, "要播放的视频地址:" + path);
Intent intent = new Intent(Intent.ACTION_VIEW);
String type = "video/*";
Uri uri = Uri.fromFile(new File(path));
intent.setDataAndType(uri, type);
startActivity(intent);
}
private void previewImg(String path) {
Log.d(TAG, "要预览的图片地址:" + path);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.addCategory(Intent.CATEGORY_DEFAULT);
Uri uri = Uri.fromFile(new File(path));
intent.setDataAndType(uri, "image/*");
startActivity(intent);
}