Android ACTION_SEND different texts for each application

I am using Intent with ACTION_SEND and I need to separate different texts. I need to send text to Gmail, and I need to send another text to Twitter. depends on the application. Can I get the application selected by the user before the application sends the selected text?

+5
source share
3 answers

In general, you cannot be sure which application will receive your intention ACTION_SEND.

This answer explains why you probably shouldn't do the tuning based on predicting which application the user will be working in.

TwiDroyd, , , , .

+3

, , , . , ..:

:

Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
List activities = getPackageManager().queryIntentActivities(sharingIntent,0);

. , .

+4

I have no idea what user-selected application to send.

But you can programmatically select apk to discover your intent with IntentResolver.

0
source

All Articles