2
我試圖在撥號時顯示活動選擇器菜單。繼發送電子郵件時的代碼對我的作品(從真正的手機,並不在模擬器上工作):如何在android中撥號時顯示活動選擇器菜單?
/* Create the Intent */
final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
/* Fill it with Data */
emailIntent.setType("plain/text");
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{"[email protected]"});
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject");
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Text");
/* Send it off to the Activity-Chooser */
this.startActivity(Intent.createChooser(emailIntent, "Send mail..."));
但是,當我改變代碼爲:
Intent call = new Intent(android.content.Intent.ACTION_CALL);
call.setData(Uri.parse("tel:" + phoneNo));
this.startActivity(Intent.createChooser(call, "Hello there..."));
無活動選擇器菜單顯示,只需直接撥號。我也想在該菜單中列出Skype。你有什麼主意嗎?
這正是我的觀點。但正如我所知,Skype是一個呼叫應用程序,顯然應該處理一個電話。有沒有辦法強制註冊一個意圖的應用程序? – ruben 2011-06-14 20:05:02
或者我怎麼知道第三方應用程序處理的意圖? – ruben 2011-06-14 20:08:02
那麼,如果這個人沒有安裝Skype,你不希望Skype在該菜單上?如果安裝了*,則Skype會自行註冊。除非你說Skype已經安裝,而你仍然沒有在該菜單上看到它? – kabuko 2011-06-14 20:11:23