Android method of making calls

Android APP development process, some of us need to dial a fixed number click on the button. We can call the following method to achieve this function.

public static void callPhone(Context context,String phoneNumber){
    Intent intent = new Intent();
    intent.setAction(Intent.ACTION_CALL);
    Uri uri = Uri.parse("tel:"+phoneNumber);
    intent.setData(uri);
    context.startActivity(intent);
}

This method can be written in a stationary tools, call use.

Guess you like

Origin blog.csdn.net/weixin_38322371/article/details/88710084