mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-04-24 07:46:07 +00:00
Don't process QR code if ScannerActivity is finished
This commit is contained in:
parent
74ecdec637
commit
12683e3ff0
1 changed files with 5 additions and 0 deletions
|
@ -178,6 +178,10 @@ public class ScannerActivity extends AegisActivity implements QrCodeAnalyzer.Lis
|
||||||
@Override
|
@Override
|
||||||
public void onQrCodeDetected(Result result) {
|
public void onQrCodeDetected(Result result) {
|
||||||
new Handler(getMainLooper()).post(() -> {
|
new Handler(getMainLooper()).post(() -> {
|
||||||
|
if (isFinishing()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (_analysis != null) {
|
if (_analysis != null) {
|
||||||
try {
|
try {
|
||||||
Uri uri = Uri.parse(result.getText().trim());
|
Uri uri = Uri.parse(result.getText().trim());
|
||||||
|
@ -190,6 +194,7 @@ public class ScannerActivity extends AegisActivity implements QrCodeAnalyzer.Lis
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
||||||
unbindPreview(_cameraProvider);
|
unbindPreview(_cameraProvider);
|
||||||
|
|
||||||
Dialogs.showErrorDialog(this,
|
Dialogs.showErrorDialog(this,
|
||||||
e.isPhoneFactor() ? R.string.read_qr_error_phonefactor : R.string.read_qr_error,
|
e.isPhoneFactor() ? R.string.read_qr_error_phonefactor : R.string.read_qr_error,
|
||||||
e, ((dialog, which) -> bindPreview(_cameraProvider)));
|
e, ((dialog, which) -> bindPreview(_cameraProvider)));
|
||||||
|
|
Loading…
Add table
Reference in a new issue