簡體   English   中英

在使用意圖選擇器時,如何知道用戶選擇了哪個應用程序?

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM