问题
I want to trigger an intent that opens the dialer adds a number and then
presses the call
bottom.
Is there any way to do the press
bottom ?
private void SendDialIntent() {
Intent intent = new Intent(Intent.ACTION_DIAL);
intent.setData(Uri.parse("tel:" + phone.phone));
startActivity(intent);
}
回答1:
You cannot "press the call button". You can use ACTION_CALL
(instead of ACTION_DIAL
), which will directly place the phone call. This requires the CALL_PHONE
permission and will not work for emergency numbers (e.g., 911 in the US).
来源:https://stackoverflow.com/questions/27830232/how-to-add-a-dial-number-and-press-the-call-bottom