I could only find "how to make a call from your application" and the solution is:
EditText et = (EditText) findViewById(R.id.editText);
String s = et.getText().toString();
try {
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:" + s));
startActivity(callIntent);
} catch (ActivityNotFoundException activityException) {
Log.d("Calling a Phone Number", "Call failed" + activityException);
}
But this directly makes a call, without confirming. Like if the number must be preceded with a 0
user must be allowed to do it and then make a call and once the call is finished he must be taken back to the application activity where he started the intent.
Simply change Intent.ACTION_CALL
to Intent.ACTION_VIEW
in your code.
Update:
To call just the phone use Intent.ACTION_DIAL
, however Intent.ACTION_VIEW
call messaging or phone.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With