Reputation: 1641
I've a sequence of image paths on my sd card and I display them on a list. I'd like to associate the onitemclick to image visualization and, rather than create my own activity, I wanted to know if there was an intent which, given an image path, displays it.
Upvotes: 0
Views: 85
Reputation: 16398
This solution assumes that you have the path of your image:
Intent intent = new Intent();
intent.setAction(android.content.Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(path)), "image/png");
startActivity(intent);
Upvotes: 1