Add onBackPressed method to do not generate crash (#29)

This commit is contained in:
Jean-Baptiste 2024-03-29 16:04:37 +01:00 committed by jacques
parent 9658a3013f
commit ef532393e4

View file

@ -88,6 +88,11 @@ public class CustomScannerActivity extends Activity implements DecoratedBarcodeV
capture.onDestroy(); capture.onDestroy();
} }
@Override
public void onBackPressed(){
onCancel(this.getCurrentFocus());
}
@Override @Override
protected void onSaveInstanceState(Bundle outState) { protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState); super.onSaveInstanceState(outState);