Its easy to make a phone call by using intent in android for this example we can user an editText and button with property of editText is set to inputType="phone" that ll accept only numbers.
On basis of intent an action to be performed i.e ACTION_DIAL, and data to be set will be mobile number in uri parsing. Uri.parse creates a Uri which parses the given encoded URI string.
Intent intnet = new Intent(Intent.ACTION_CALL);
intnet.setData(Uri.parse("tel:"+number));
Finally, we should start the activity as shown below :
startActivity(callIntent);
Android permission to make call
<uses-permission android:name="android.permission.CALL_PHONE" />
0 Comment(s)