Example usage for android.content Intent ACTION_DIAL

List of usage examples for android.content Intent ACTION_DIAL

Introduction

In this page you can find the example usage for android.content Intent ACTION_DIAL.

Prototype

String ACTION_DIAL

To view the source code for android.content Intent ACTION_DIAL.

Click Source Link

Document

Activity Action: Dial a number as specified by the data.

Usage

From source file:Main.java

public static void callPhone(Context context, String number) {
    Intent intent2 = new Intent(Intent.ACTION_DIAL);
    if (TextUtils.isEmpty(number))
        return;/*from  www .  j av  a2  s . c  om*/
    Uri data2 = Uri.parse("tel:" + number);
    intent2.setData(data2);
    context.startActivity(intent2);
}

From source file:Main.java

public static void makePhoneCall(Activity activity, String phone) {
    Uri uri = Uri.parse("tel:" + phone);
    Intent it = new Intent(Intent.ACTION_DIAL, uri);
    activity.startActivity(it);//from  w w  w  .  j a va 2s  . c  o  m
}

From source file:Main.java

public static void openDial(Context getContext, String number) {
    Uri uri = Uri.parse("tel:" + number);
    Intent it = new Intent(Intent.ACTION_DIAL, uri);
    getContext.startActivity(it);//from   w w w.  j  av  a 2 s . com
}

From source file:Main.java

public static void callPhone(Context context, String number) {
    Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse(URL_TEL + number));
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    context.startActivity(intent);//from ww  w.  j  a  v  a2s  .  c om
}

From source file:Main.java

@NonNull
public static Intent openDialer(@NonNull String number) {
    return new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + number));
}

From source file:Main.java

public static void phoneCall(Context context, String phoneNumber) {
    Uri phoneCall = Uri.parse("tel:" + phoneNumber);
    Intent caller = new Intent(Intent.ACTION_DIAL, phoneCall);
    context.startActivity(caller);/*from   w  w  w .ja v a  2  s  .  c o m*/
}

From source file:Main.java

public static void call(String phoneNum, Context context) throws Exception {//TODO tobe test
    Intent intent = new Intent();
    intent.setAction(Intent.ACTION_DIAL);
    intent.setData(Uri.parse("tel:" + phoneNum));
    context.startActivity(intent);//  w ww . j a v a 2 s  .  c o m
}

From source file:Main.java

public static void gotoCall(Context context, String phoneNumber) {
    try {//  w ww .  j  a v a 2  s  . co  m
        Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel://" + phoneNumber));
        context.startActivity(intent);
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:Main.java

public static void dialNumber(Activity context, String phoneNumber) {
    if (context == null) {
        return;//from ww  w .ja  v  a  2 s.  com
    }
    Intent intent = new Intent(Intent.ACTION_DIAL);
    intent.setData(Uri.parse("tel:" + phoneNumber));
    context.startActivity(intent);
}

From source file:Main.java

public static void showViewDial(String phoneNumber, Activity activity) {
    Intent intent = new Intent();
    intent.setAction(Intent.ACTION_DIAL);
    intent.setData(Uri.parse("tel:" + phoneNumber));
    activity.startActivity(intent);/*from w ww . ja v  a2  s.c o m*/
}