Android的份额意图选择器 [英] Android share intent chooser

查看:109
本文介绍了Android的份额意图选择器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是这样的共享使用可用的应用程序在用户的手机上的一些文字。

I am using something like this to share some text using available applications on the user's phone.

public void share(String subject,String text) {
     final Intent intent = new Intent(Intent.ACTION_SEND);

     intent.setType("text/plain");
     intent.putExtra(Intent.EXTRA_SUBJECT, subject);
     intent.putExtra(Intent.EXTRA_TEXT, text);

     startActivity(Intent.createChooser(intent, getString(R.string.share)));
}

我的主要问题是,我想有一个不同的文本,如果用户选择,而不是电子邮件,微博为例(短版与短网址VS全文附有图片)。

My main problem is that I would like to have a different text if the user chooses Twitter instead of email for example (short version with short URLs VS full text with attached images).

如何ONT找出哪个应用程序的用户决定使用?

How can ont find out which application the user has decided to use?

推荐答案

在你手上的文本关闭到系统createChooser其伸出你的双手,没有办法之后更改文本。

Once you hand the text off to the system with createChooser its out of your hands, no way to change the text after that.

这篇关于Android的份额意图选择器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆