You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code actually crashes when the permission of accessing the camera is already given. The following functions solved that issue for me. Please make a check before requesting a camera in the onCreate function.
private boolean isCameraPermissionGranted(){
int selfPermission= ContextCompat.checkSelfPermission(getBaseContext(), Manifest.permission.CAMERA);
return selfPermission==PackageManager.PERMISSION_GRANTED;
}
The text was updated successfully, but these errors were encountered:
The code actually crashes when the permission of accessing the camera is already given. The following functions solved that issue for me. Please make a check before requesting a camera in the onCreate function.
private boolean isCameraPermissionGranted(){
int selfPermission= ContextCompat.checkSelfPermission(getBaseContext(), Manifest.permission.CAMERA);
return selfPermission==PackageManager.PERMISSION_GRANTED;
}
The text was updated successfully, but these errors were encountered: