如何知道用户选择的应用程序使用意向选择器是什么时候?(How to know which appli

2019-10-31 16:57发布

我使用的是意图选择器邀请朋友:

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"));

有没有办法知道哪些应用程式在选择器中选择的用户?

Answer 1:

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.



文章来源: How to know which application the user chose when using an intent chooser?