小编Jev*_*rlo的帖子

如何使用Intent.ACTION_VIEW查看文件夹的内容?

我正在尝试使用意图查看特定文件夹中的图像。我的代码如下:

Intent intent = new Intent();  
intent.setAction(Intent.ACTION_VIEW);  
Uri imgUri = Uri.parse("file://sdcard/download");  
intent.setDataAndType(imgUri, "image/*");  
startActivity(intent);  
Run Code Online (Sandbox Code Playgroud)

但是,每次运行时,我都会在日志中收到此消息:

02-25 00:40:16.271:错误/(8359):无法打开'/下载
'02-25 00:40:16.271:错误/(8359):无法打开'/下载'

我究竟做错了什么?

android sd-card android-manifest android-intent

5
推荐指数
1
解决办法
3万
查看次数