I'm trying to share a text by my app using ACTION_SEND in the intent. But if you choose using an app for default, it will share with the same app without asking everytime.
Can someone help me with it?
if it's posible, it should be able to share via mail, facebook, twitter, whatsapp like this code do. Thanks.
Intent textShareIntent = new Intent(Intent.ACTION_SEND);
textShareIntent.putExtra(Intent.EXTRA_TEXT, "Text to share, URL");
textShareIntent.setType("text/plain");
startActivity(textShareIntent);
Try this
Intent textShareIntent = new Intent(Intent.ACTION_SEND);
textShareIntent.putExtra(Intent.EXTRA_TEXT, "Text to share, URL");
textShareIntent.setType("text/plain");
if (textShareIntent.resolveActivity(getPackageManager()) != null)
startActivity(Intent.createChooser(textShareIntent, "Share"));
else
// no app can handle this intent, do something else
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With