Skip to content
This repository was archived by the owner on Jan 12, 2019. It is now read-only.

Commit 1ff8f33

Browse files
committed
Fix manual entry Activity started twice when rejecting camera permission
Fixes #128 Fixes card-io/card.io-Android-SDK#150
1 parent 56ad4b8 commit 1ff8f33

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

card.io/src/main/java/io/card/payment/CardIOActivity.java

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -643,20 +643,15 @@ protected void onDestroy() {
643643
}
644644

645645
@Override
646-
public void onRequestPermissionsResult(int requestCode,
647-
String permissions[], int[] grantResults) {
648-
switch (requestCode) {
649-
case PERMISSION_REQUEST_ID: {
650-
waitingForPermission = false;
651-
if (grantResults.length > 0
652-
&& grantResults[0] == PackageManager.PERMISSION_GRANTED){
653-
showCameraScannerOverlay();
654-
655-
} else {
656-
manualEntryFallbackOrForced = true;
657-
// show manual entry - handled in onResume()
658-
}
659-
onResume();
646+
public void onRequestPermissionsResult(int requestCode, String permissions[],
647+
int[] grantResults) {
648+
if (requestCode == PERMISSION_REQUEST_ID) {
649+
waitingForPermission = false;
650+
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
651+
showCameraScannerOverlay();
652+
} else {
653+
// show manual entry - handled in onResume()
654+
manualEntryFallbackOrForced = true;
660655
}
661656
}
662657
}

0 commit comments

Comments
 (0)