I'm trying to open a picture in the build-in gallery, but it dosen't show up. I logged the URI to be
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);
}
});
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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With