if(checkSelfPermission(Manifest.permission.CAMERA)!=PackageManager.PERMISSION_GRANTED) {
// Permission has not been granted and must be requested.
if (shouldShowRequestPermissionRationale(Manifest.permission.CAMERA)) {
Toast.makeText(this, "Camera access is required to display a camera preview.",Toast.LENGTH_SHORT).show();
//我想在此处更改提示消息,而不是提供Toast消息 消息可以解释为什么需要许可 } }