Posted By

funkypanda on 06/04/10


Tagged

phone call android intent


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

MicronXD


Start a phone call from Android application


 / Published in: Java
 

URL: http://www.lacherstorfer.at/haris_blog/2008/03/android-howto-invoke-a-phone-c.html

a 2-lines code to start a phone call from your Android application

  1. try {
  2. Intent intent = new Intent(Intent.ACTION_CALL);
  3. intent.setData(Uri.parse("tel:+123456"));
  4. startActivity(intent);
  5. } catch (Exception e) {
  6. Log.e("SampleApp", "Failed to invoke call", e);
  7. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: funkypanda on June 4, 2010

You must add call permission tag in the AndroidManifest.xml file :

put

after

Posted By: funkypanda on June 4, 2010

You must add call permission tag in the AndroidManifest.xml file :

put

after

Posted By: funkypanda on June 4, 2010

uses-permission android:name="android.permission.CALL_PHONE" tag

You need to login to post a comment.