/**
* 调起系统打电话功能
*/
public void doCallPhoneTo(String phoneNumber) {
if (PhoneNumberUtils.isGlobalPhoneNumber(phoneNumber)) {
if (mayCallPhone()) {
Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + phoneNumber));
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CALL_PHONE)
!= PackageManager.PERMISSION_GRANTED) {
// TODO: Consider calling
// ActivityCompat#requestPermissions
// here to request the missing permissions, and then overriding
// public void onRequestPermissionsResult(int requestCode, String[] permissions,
// int[] grantResults)
// to handle the case where the user grants the permission. See the documentation
// for ActivityCompat#requestPermissions for more details.
return;
}
startActivity(intent);
}
}
}
MemberDetailsActivity.java 文件源码
java
阅读 21
收藏 0
点赞 0
评论 0
项目:ITSM
作者:
评论列表
文章目录