I have one activity(MyActivity), in which I have a grid view. Also I have the "add existing photo from gallery " button. When we click on this button it will open the gallery viewer application and after selecting any photo in gallery it will update the gridview in MyActivity. Also I am storing the selected photos in the myimage folder in sdcard.
I want that if I will select any particular cell in grid view it will open the photoviewer to display all the images present in that folder (myimage).
The code is given below
public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {
try {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse("file:///sdcard/myimage/*"),
"image/*");
startActivity(intent);
}
This code, on clicking particular cell of grid view, opens the photoviewer, but not showing any photos in that folder.
But if I use this code
public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {
try {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse("file:///sdcard/myimage/a.jpg"),
"image/*");
startActivity(intent);
}
it is showing only the photo a.jpg, not all the photos in the myimage folder. Also not showing the next and previous arrow in the photoviewer.
I want to display all the images present in a particular folder in sd card with next and previous arrow so, that we can traverse through all the photos.
If this is not possible in this way, suggest me other approach(please attach the code also).