![](/img/trans.png)
[英]How to determine which app the user selects with the default startActivity(intent) chooser?
[英]How to know which application the user chose when using an intent chooser?
我正在使用意图选择器邀请朋友:
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_SUBJECT, Resources.getString("InvitationSubject", getBaseContext()));
String body = Resources.getString("InvitationBody", getBaseContext()) + Local.User.FirstName;
intent.putExtra(Intent.EXTRA_TEXT, body);
startActivity(Intent.createChooser(intent, "Invite friends"));
有没有办法知道用户在选择器中选择了哪个应用程序?
据我所知,没有直接的方法来收集此类信息。 您需要什么? Imho设计了android intent系统,因此,作为应用程序开发人员,您不必担心用户选择了哪种应用程序来处理您的意图。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.