Android open gallery from folder

I want to show a photo in android gallery and be able to move photos of other photos in that folder.

Intent intent = new Intent(Intent.ACTION_VIEW);
File f = new File(path);
intent.setDataAndType(Uri.parse("file://" + f.getAbsolutePath()), "image/*");
mContext.startActivity(intent);

      

thats how i am doing it now but not letting me slide, leaving the rest of the images in the folder. I tried:

How to open one specific folder from gallery in android?

Built-in gallery in a specific folder

Gallery with folder filter

No luck. I would be very glad if someone had a solution. Thank!

+3


source to share


2 answers


try it

Intent i=new Intent();
i.setAction(Intent.ACTION_VIEW);
i.setDataAndType(Uri.fromFile(new File(path)), "image/*");  
startActivity(i);

      

See these links

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

Android ACTION_VIEW Multiple Images



Java and Android: how to open multiple files with intent?

if that solves your problem. Also check

https://www.google.co.in/?gfe_rd=cr&ei=c5n9U6ruE7DO8gfXz4G4BA&gws_rd=ssl#q=view+like+gallery

also check the widget Gallery

+6


source


Try this way, hope it helps you solve your problem.



final int OPEN_GALLERY = 1
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, ""), OPEN_GALLERY);

      

0


source







All Articles