Search code examples
androidimageviewandroid-gallery

Open image set in ImageView into the Gallery on clicking on image


I have set an image in ImageView and have its uri and path. Now I want when I click on that image in ImageView, It should pop up or get displayed in orignl size in gallery.

Every code available is for picking up image from gallery, but I want to view a known image in gallery. Please help.


Solution

  • set this code on clicklistner :

    Intent intent = new Intent();
    intent.setAction(Intent.ACTION_VIEW);
    intent.setDataAndType(Uri.parse("filepath"), "image/*");
    startActivity(intent);