I'm trying to share an image on social networks, which I get from a URL I tried several ways and I have not succeeded, I use retrofit2 to show the content of the application.
Thank you very much in advance
Here I get the url of the image
Glide.with(mContext)
.load(appointment.getmImage())
.thumbnail(0.5f)
.override(250, 120)
.crossFade()
.diskCacheStrategy(DiskCacheStrategy.ALL)
.bitmapTransform(new RoundedCornersTransformation(mContext, 10, 0)
)
.into(holder.imagee);
This is the code I use to share on social networks
btnshared.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
final Intent intent = new Intent(android.content.Intent.ACTION_SEND);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(Intent.EXTRA_TITLE, titulocompartir.getText().toString());
intent.putExtra(Intent.EXTRA_TEXT, comentariocompartir.getText().toString());
imagee.buildDrawingCache();
Bitmap image= imagee.getDrawingCache();
extras.putParcelable(Intent.EXTRA_STREAM, image);
intent.setType("image/*");
mContext.startActivity(intent);
}
});
social networks will be available depending on the applications you have installed, if normal sharing does only text but the problem comes when I try to share an image does not load it in the post