80,351
社区成员
发帖
与我相关
我的任务
分享
public void onBtn_Call(View v) {
Intent itt = new Intent(Intent.ACTION_CALL);
itt.setData(Uri.parse("tel:9888998"));
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(itt);
}