Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use Intent.ACTION_VIEW to view the contents of a folder?

I'm trying to view the images in a specific folder using an intent. My code is as follows:

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

However, each time it runs, I get this message in the log:

02-25 00:40:16.271: ERROR/(8359): can't open '/download'
02-25 00:40:16.271: ERROR/(8359): can't open '/download'

What am I doing wrong?

like image 776
Jevarlo Avatar asked Nov 06 '22 02:11

Jevarlo


1 Answers

I think this is far simpler than everyone else is suggesting. I believe the path is case sensitive. In your example "file://sdcard/Download" should work.

like image 196
nebuhcaneza Avatar answered Nov 14 '22 21:11

nebuhcaneza