android 调用系统打电话

来源:互联网 发布:赵梦暄淘宝店 编辑:程序博客网 时间:2024/04/29 19:12

调用系统打电话有两种方法

1.直接调用拨打

startActivity(new Intent(Intent.ACTION_CALL, Uri.parse("tel:" +phone)));


权限:<uses-permissionandroid:name="android.permission.CALL_PHONE"/>

2.调用拨号码界面

Intent intent = new Intent(Intent.ACTION_DIAL,Uri.parse("tel:" +phone));

intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

startActivity(intent);


0 0
原创粉丝点击