Make sure cancel is handled properly in a few cases, where app must exit after dialog
[zxing.git] / android / src / com / google / zxing / client / android / CaptureActivity.java
index 8a6d257..249fd84 100755 (executable)
@@ -723,11 +723,8 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
     AlertDialog.Builder builder = new AlertDialog.Builder(this);
     builder.setTitle(getString(R.string.app_name));
     builder.setMessage(getString(R.string.msg_camera_framework_bug));
     AlertDialog.Builder builder = new AlertDialog.Builder(this);
     builder.setTitle(getString(R.string.app_name));
     builder.setMessage(getString(R.string.msg_camera_framework_bug));
-    builder.setPositiveButton(R.string.button_ok, new DialogInterface.OnClickListener() {
-      public void onClick(DialogInterface dialogInterface, int i) {
-        finish();
-      }
-    });
+    builder.setPositiveButton(R.string.button_ok, new FinishListener(this));
+    builder.setOnCancelListener(new FinishListener(this));
     builder.show();
   }
 
     builder.show();
   }