/** * 拨打电话(跳转到拨号界面,用户手动点击拨打) * * @paramphoneNum 电话号码 */ public void diallPhone(String phoneNum) {
Intent intent = new Intent(Intent.ACTION_DIAL);
Uri data = Uri.parse("tel:" + phoneNum);
intent.setData(data);
startActivity(intent);
}
/** * 拨打电话(直接拨打电话) * * @paramphoneNum 电话号码 */ public void callPhone(String phoneNum) {
Intent intent = new Intent(Intent.ACTION_CALL);
Uri data = Uri.parse("tel:" + phoneNum);
intent.setData(data);
startActivity(intent);
}
引自 https://blog.csdn.net/bin622/article/details/72453622