diff --git a/app/src/main/java/com/cringe_studios/code_guard/scanner/QRScannerActivity.java b/app/src/main/java/com/cringe_studios/code_guard/scanner/QRScannerActivity.java index cd0846d..0fb4666 100644 --- a/app/src/main/java/com/cringe_studios/code_guard/scanner/QRScannerActivity.java +++ b/app/src/main/java/com/cringe_studios/code_guard/scanner/QRScannerActivity.java @@ -83,6 +83,15 @@ public class QRScannerActivity extends BaseActivity { scanner = new QRScanner(); } + @Override + public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { + super.onRequestPermissionsResult(requestCode, permissions, grantResults); + + if(requestCode == 1234 && grantResults[0] != PackageManager.PERMISSION_GRANTED) { + error(getString(R.string.error_no_camera_permission)); + } + } + void bindPreview(@NonNull ProcessCameraProvider cameraProvider) { Preview preview = new Preview.Builder() .build(); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 18cab12..c0d3b13 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -149,6 +149,7 @@ "Failed to read image: " Icon pack already exists Failed to import icon pack + No camera permission Image from icon pack Image from gallery