DONE
}
- CaptureActivityHandler(CaptureActivity activity,
- Vector<BarcodeFormat> decodeFormats,
- String characterSet,
- boolean beginScanning) {
+ CaptureActivityHandler(CaptureActivity activity, Vector<BarcodeFormat> decodeFormats,
+ String characterSet) {
this.activity = activity;
decodeThread = new DecodeThread(activity, decodeFormats, characterSet,
new ViewfinderResultPointCallback(activity.getViewfinderView()));
// Start ourselves capturing previews and decoding.
CameraManager.get().startPreview();
- if (beginScanning) {
- restartPreviewAndDecode();
- }
+ restartPreviewAndDecode();
}
@Override
Log.d(TAG, "Got decode succeeded message");
state = State.SUCCESS;
Bundle bundle = message.getData();
- Bitmap barcode = bundle == null ? null : (Bitmap) bundle.getParcelable(DecodeThread.BARCODE_BITMAP);
+ Bitmap barcode = bundle == null ? null :
+ (Bitmap) bundle.getParcelable(DecodeThread.BARCODE_BITMAP);
activity.handleDecode((Result) message.obj, barcode);
break;
case R.id.decode_failed:
Log.d(TAG, "Got product query message");
String url = (String) message.obj;
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
- intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
activity.startActivity(intent);
break;
}
try {
decodeThread.join();
} catch (InterruptedException e) {
+ // continue
}
// Be absolutely sure we don't send any queued up messages