Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android dial a phone number programmatically

How do I dial a number programmatically from the Android application? I don't want to make a call, which I know I can do by making an intent: new Intent(Intent.ACTION_CALL), I just want to take the user to the Android dial prompt, with the number already input by passing it through the intent, so that she has the option to call that number herself.

like image 331
Sergo Pasoevi Avatar asked Mar 13 '14 08:03

Sergo Pasoevi


People also ask

How can I call a number in Android Studio?

Intent phoneIntent = new Intent(Intent. ACTION_CALL); You can use ACTION_DIAL action instead of ACTION_CALL, in that case you will have option to modify hardcoded phone number before making a call instead of making a direct call.

How do I get the dialer to open with phone number displayed?

Intent intent = new Intent(Intent. ACTION_DIAL); intent. setData(Uri. parse("tel:0123456789")); startActivity(intent);


1 Answers

Use the below code:

Uri number = Uri.parse("tel:123456789"); Intent callIntent = new Intent(Intent.ACTION_DIAL, number); startActivity(callIntent); 
like image 56
Systematix Infotech Avatar answered Sep 23 '22 20:09

Systematix Infotech