App does not share using Whatsapp appears: "Failed to share. Pro please try again."

Asked

Viewed 498 times

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!

1 answer

-1

In fact, the problem is that you try to share a remote image as a local stream. If I remember correctly, Whatsapp allows sending files via Base64 to the Internet or to a local file.

Browser other questions tagged

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