I've been trying for days to get Shared Intent working on Android with an image, text and a link at the bottom. In the image is what I want to achieve. You can see what I get at the bottom.
This is the code I have right now:
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_TEXT, Html.fromHtml("<img src='http://example.com/images/image.jpg'><br />This is the text shared.<br />http://example.com"));
// shareIntent.putExtra(Intent.EXTRA_STREAM, DownloadImage("http://example.com/images/image.jpg"));
// shareIntent.putExtra(Intent.EXTRA_STREAM, Html.fromHtml("<img src='http://example.com/images/image.jpg'>"));
shareIntent.setType("*/*");
// shareIntent.setType("image/jpeg");
// shareIntent.setType("text/html");
shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
shareIntent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
startActivity(Intent.createChooser(shareIntent, "Share some data"));
What am I doing wrong? I have commented some things I have tried. Thanks for your help!
I have tried multiple data types and different types of image loading. Loading from url doesn't work and inserting a bitmap doesn't work. (DownloadImage returns a Bitmap and I have checked that it has no errors) I've replaced the url.