0

I would to share a picture to other app.I am viewing the image now through get it by intent from other activity. by this code I get image:

   final String imageurl = i.getStringExtra("Image");

And I viewing by Picasso:

 Picasso.get().load(imageurl).into(prImg);

Now the question is how to share the displayed image to different applications through the following code:

     // Share image
        private void shareImage( ) {
            Intent sharingIntent = new Intent(Intent.ACTION_SEND);
            sharingIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
            sharingIntent.setType("image/*");
            sharingIntent.putExtra(Intent.EXTRA_STREAM, imageUri);
            startActivity(Intent.createChooser(sharingIntent, "Share Image Using"));

Or I have to use other code to do it?

  • 2
    Does this answer your question? [How to use "Share image using" sharing Intent to share images in android?](https://stackoverflow.com/questions/7661875/how-to-use-share-image-using-sharing-intent-to-share-images-in-android) – Hussein El Feky Jul 01 '20 at 18:58
  • @HusseinElFeky No brother I get image from intent –  Jul 01 '20 at 19:09

0 Answers0