簡體   English   中英

使用標准的電話應用程序來“完成操作”,以便在android中撥打電話

[英]use standard phone app to “complete an action” of phone call in android

我在設備上安裝了Skype,因此當我運行這樣的代碼時

String numb = prefs.getString("top_number", "+380931112223");
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:+" + numb));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(Intent.FLAG_FROM_BACKGROUND);
startActivity(intent);    

系統會引發對話框,詢問要使用哪個應用程序來完成操作:電話或Skype。 如何避免這種情況並以編程方式使用標准的Phone應用程序?

你不能 這是處理特定操作(在您的情況下為Intent.ACTION_CALL )的默認Android行為。 出現對話框時,您只能選擇該時間的應用程序或將所選的應用程序設置為默認應用程序。 如果選擇了后一個選項,並且您再次運行代碼,則應用程序將立即打開,而不顯示對話框

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

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