[英]I want to make a button that open browser and then redirect to phone dialer
[英]How can I make a button to show a number in the phone dialer
我需要調用撥號程序並在其上粘貼一個字符串。
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:123456789"));
startActivity(callIntent);
這樣,它將開始呼叫該號碼。 我不希望它開始打電話只是將那個號碼發送到默認撥號程序。
像這樣
對您的Intent
操作使用ACTION_DIAL
:
startActivity(new Intent(Intent.ACTION_DIAL, Uri.parse("tel:123456789")));
用途 :
Intent callIntent = new Intent(Intent.ACTION_DIAL);
callIntent.setData(Uri.parse("tel:123456789"));
startActivity(callIntent);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.