2
votes

I have retrieved the uri of the image But when i use

startActivity(new Intent(Intent.ACTION_VIEW,mediaUri));

the image is viewed in image viewer but i can also see other gallery images.

How to avoid this.

I only want the single image to open in image viewer.

1

1 Answers

1
votes

This may help you

Intent i = new Intent(android.content.Intent.ACTION_VIEW);
i.setDataAndType(Uri.parse("file:///sdcard/path/to/myfile.png"),"image/png");
startActivity(i);