[英]How to know which application the user chose when using an intent chooser?
I'm using an intent chooser to invite friends : 我正在使用意图选择器邀请朋友:
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"));
Is there a way to know which app the user selected in the chooser ? 有没有办法知道用户在选择器中选择了哪个应用程序?
As far as I know, there is no direct way to gather such information. 据我所知,没有直接的方法来收集此类信息。 What would you need it for?
您需要什么? Imho the android intent system was designed so you, as an app developer, don't have to worry about what app the user chose to handle your intent.
Imho设计了android intent系统,因此,作为应用程序开发人员,您不必担心用户选择了哪种应用程序来处理您的意图。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.