Share Intent imageview

Asked

Viewed 64 times

0

Good guys I’m wanting to make one Share / Share of an image with intent, but this image is already defined with a id.

How do I accomplish this share?
Follow my code that is giving error:

// Metodo do botão
public void Share (View view){

//Ter Acesso a imaem atraves do 
ImageView ivCar = (ImageView) findViewById(R.id.iv_car);

    Intent sharingIntent =  new  Intent ( Intent .ACTION_SEND);
Uri screenshotUri = Uri.parse(MediaStore.Images. Media . EXTERNAL_CONTENT_URI +  "/"  + ivCar );
    sharingIntent . setType("image/jpeg");
sharingIntent . putExtra(Intent.EXTRA_STREAM, screenshotUri);

startActivity(Intent.createChooser ( sharingIntent ,  "Share imagem usando " ));
  • The image that’s on Imageview comes from where?

  • Check the logcat for the image address, you may need to convert the address. to make it easy to show us the error logcat.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.