草庐IT

即使我使用dexter库专门询问权限,也需要在使用此代码行之前获得许可

@OverridepublicvoidonClick(Viewv){Dexter.withActivity(this).withPermission(Manifest.permission.CALL_PHONE).withListener(newPermissionListener(){@OverridepublicvoidonPermissionGranted(PermissionGrantedResponseresponse){IntentcallIntent=newIntent(Intent.ACTION_CALL);callIntent.setData(Uri.parse("tel:1

android - PHONE_CALL 权限在 Dexter 中不起作用

我已经实现了Dexter在我的应用程序中。它适用于CAMERA、EXTERNALSTORAGE和INTERNALSTORAGE权限。我想用Dexter的PHONE_CALL权限打电话.当我调用这样的电话时:IntentcallIntent=newIntent(Intent.ACTION_CALL,Uri.parse("tel:"+strNum));startActivity(callIntent);然后startActivity显示警告调用需要可能被用户拒绝的权限:代码应该显式检查权限是否可用(使用checkPermission)或显式处理潜在的SecurityExceptionles