call a telephone number via Intent - Android android.content

Android examples for android.content:Intent

Description

call a telephone number via Intent

Demo Code

import android.content.Context;
import android.content.Intent;
import android.net.Uri;

public class Main {

  public static void callContact(Context context, String cellphone) {
    Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + cellphone));
    context.startActivity(intent);//  ww w .j av a  2  s.com
  }

}

Related Tutorials