Wednesday 17 August 2011

Calling Programmatically

You can initiate call programmatically. Let's do it:

Intent call = new Intent(Intent.ACTION_CALL);
call.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
call.setData(Uri.parse("tel:" + number));
startActivity(call);

Note: Add the permission to the manifest file:
<uses-permission android:name="android.permission.CALL_PHONE" />

No comments:

Post a Comment