1
When I choose Whatsapp to share appears a message:
"Failed to share. Please try again."
My code is like this:
compartilhar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String uriToImage = "http://192.168.0.50/img001.jpeg";
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
shareIntent.putExtra(Intent.EXTRA_STREAM, uriToImage);
shareIntent.setType("image/jpeg");
startActivity(Intent.createChooser(shareIntent, null));
}
});
I think it might be a permissions problem. I don’t know how to fix it. I need help!