Call phone Specify call phone permission - Android App

Android examples for App:Manifest

Description

Call phone Specify call phone permission

Demo Code


//package com.java2s;

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

public class Main {
    /**//  ww  w. j  a v a2 s  . c  o m
     * Call phone<p/>
     * Specify call phone permission<p/>
     *
     * @param context  Context
     * @param phoneNum The number you wanna dial
     */
    @SuppressWarnings("ResourceType")
    public static void callPhoneNum(Context context, String phoneNum) {
        Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:"
                + phoneNum));
        context.startActivity(intent);
    }
}

Related Tutorials