state = State.DONE;
Message quit = Message.obtain(decodeThread.handler, R.id.quit);
quit.sendToTarget();
+ try {
+ decodeThread.join();
+ } catch (InterruptedException e) {
+ }
Looper.myLooper().quit();
break;
case R.id.decode_started:
Looper.loop();
}
+ public void quitSynchronously() {
+ Message quit = Message.obtain(handler, R.id.quit);
+ quit.sendToTarget();
+ try {
+ join();
+ } catch (InterruptedException e) {
+ }
+ }
+
public void setDecodeAllMode() {
Message message = Message.obtain(decodeThread.handler, R.id.set_decode_all_mode);
message.sendToTarget();