I have the URL to an image and I want to give the user the ability to share this images to another apps. So I am using this method:
public void share() {
if (mListener!=null){
URI uri = null;
try {
URL url = new URL(mFile.getUrl()); //Some instantiated URL object
uri = url.toURI();
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
shareIntent.setType("image/*");
startActivity(Intent.createChooser(shareIntent, getResources().getText(R.string.share)));
} catch (MalformedURLException | URISyntaxException e) {
Log.e("Sharing image", e.getMessage());
}
}
}
When I try to share to WhatsApp I get "Sharing failed, please try again" and for Telegram I get "Unsupported content" it doesn't work with any of the options I get to choose from.