-1

I am having the image url of the image (by getDownloadUrl() method) , I am able to diplay the image in image View using picasso library, but i want to open the image in inbuilt mobile gallery app when i click on the display image button.

please help...

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
Tech Amit
  • 31
  • 1
  • Welcome to Stack Overflow. Please review: https://stackoverflow.com/help/dont-ask You may consider adding a more complete example or reviewing the Tour: https://stackoverflow.com/tour – Twisty Oct 22 '18 at 15:04

1 Answers1

1

If I understand correctly you have an image in a remote location that you are downloading and displaying locally on your device by using the Picasso library and now you would like to open it in the device gallery.

So the first step will be saving this image in the Android gallery, you can review this example or google for more resources.

However, you will notice that in order to save the image in the gallery you need to get its bitmap first. Here is an example of how to do it with Picasso.

And finally, once you got your image saved you need to open the gallery app.

Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setDataAndType(imageUri), "image/*");
context.startActivity(intent);

The imageUri is the one you are getting when creating the file using

ContentResolver.insert(Images.Thumbnails.EXTERNAL_CONTENT_URI, values);
Ilya Gazman
  • 31,250
  • 24
  • 137
  • 216