Android: display image in the built-in gallery

I try to open a picture in the gallery, but it doesn’t appear. I registered URI as

06-08 15: 53: 02.232: D / URI (3231): file: ///mnt/sdcard/com.jesper.indkoeb/nm-image.jpg

which is the right place

@Override public void onClick(View v) { Intent intent = new Intent(); intent.setAction(android.content.Intent.ACTION_VIEW); File file = new File(uri.get(position)); Log.d("URI",uri.get(position)); intent.setDataAndType(Uri.fromFile(file), "image/*"); context.startActivity(intent); } }); 
+4
source share
1 answer

The following snippet will help you.

 Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(Uri.parse("file:///mnt/sdcard/image/Apples.jpg"),"image/*"); startActivity(intent); 
+9
source