Program to make a phone call in Android Phone
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkqjzqGelAPbPjC2mezex_VEhZIDyhTEp4J1Px4Ua3b_8xQ18ZmpIA8PFLPKXyoe8oEZVf5OfXw3H4mNPHbbL3UK-cOb7OwFGmifVvrz5zpoGU3TUt_dVEcpYlYXktXqNRGPRFGahp-A6Z/s320/android.jpg)
private void makecall()
{
try {
Intent phonecallIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:9884179964"));
startActivity(phonecallIntent);
}
catch (ActivityNotFoundException activityException)
{
Log.e("makeCallDemo", "Call failed", activityException);
}
}
So, in the above example the instance of Intent class will actually search for the application which provides ACTION_CALL action in this case PhoneApp and tell the android system that we want to start a phone call. The startActivity method will actually initiate the phone call to the provided number. The phone number provided above should follow the E.164 Number format.
0 comments:
Post a Comment