42

Possible Duplicate:
how to make phone call using intent in android?

Please give me code for calling the number through android Application.

Thanks a lot

Community
  • 1
  • 1
Hardik Gajjar
  • 5,038
  • 8
  • 33
  • 51

2 Answers2

123
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:123456789"));
startActivity(callIntent);

Edit: Must add <uses-permission android:name="android.permission.CALL_PHONE" /> in Manifest as well.

Burak Karakuş
  • 1,368
  • 5
  • 20
  • 43
DKIT
  • 3,471
  • 2
  • 20
  • 24
71

Try this,

Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:123456789"));
startActivity(callIntent);

And remember add this CALL_PHONE permission to your manifest.xml:

<uses-permission android:name="android.permission.CALL_PHONE" />

This may helps you.

Sathish Kumar J
  • 4,280
  • 1
  • 20
  • 48
danhnn.uit
  • 1,784
  • 1
  • 14
  • 7