开发者

Set a different text to an ACTION_SEND intent according to the application selected in the chooser [duplicate]

开发者 https://www.devze.com 2023-03-14 06:42 出处:网络
This question already has answers here: How to filter specific apps for ACTION_SEND intent (and set a different text for each app)
This question already has answers here: How to filter specific apps for ACTION_SEND intent (and set a different text for each app) (12 answers) Closed 8 years ago.

How can I set a different content (different text, image/no image...) to an ACTION_SEND intent? Basically I'd like to have a long text and an image for an email, just the long text for Facebook, and a short text for Twitter... I'm aware of this question, but开发者_如何学Python there is no answer to the question.

Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, "My text");
startActivity(Intent.createChooser(intent, "Share with"));


The simple answer still stands is that u cannot do that, there is no way to identify which application is going to handle ur intent, that choice is left onto the user. You can provide user options for facebook and twitter directly which might be useful

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号