Error when camera permission denied
This commit is contained in:
parent
aa16178a78
commit
2347f9c57e
@ -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();
|
||||
|
@ -149,6 +149,7 @@
|
||||
<string name="error_qr_scan_image_failed">"Failed to read image: "</string>
|
||||
<string name="icon_pack_exists_title">Icon pack already exists</string>
|
||||
<string name="error_import_icon_pack">Failed to import icon pack</string>
|
||||
<string name="error_no_camera_permission">No camera permission</string>
|
||||
<string-array name="edit_otp_choose_image_options">
|
||||
<item>Image from icon pack</item>
|
||||
<item>Image from gallery</item>
|
||||
|
Loading…
Reference in New Issue
Block a user