public static final String BARCODE_BITMAP = "barcode_bitmap";
- private final Handler handler;
+ private final CaptureActivity activity;
+ private final Hashtable<DecodeHintType, Object> hints;
+ private Handler handler;
DecodeThread(CaptureActivity activity,
Vector<BarcodeFormat> decodeFormats,
String characterSet,
ResultPointCallback resultPointCallback) {
- Hashtable<DecodeHintType, Object> hints = new Hashtable<DecodeHintType, Object>(3);
+
+ this.activity = activity;
+
+ hints = new Hashtable<DecodeHintType, Object>(3);
// The prefs can't change while the thread is running, so pick them up once here.
if (decodeFormats == null || decodeFormats.isEmpty()) {
}
hints.put(DecodeHintType.NEED_RESULT_POINT_CALLBACK, resultPointCallback);
-
- this.handler = new DecodeHandler(activity, hints);
}
Handler getHandler() {
@Override
public void run() {
Looper.prepare();
+ handler = new DecodeHandler(activity, hints);
Looper.loop();
}