private void sendReplyMessage(int id, Object arg, long delayMS) {
   Message message = Message.obtain(handler, id, arg);
   if (delayMS > 0L) {
     handler.sendMessageDelayed(message, delayMS);
   } else {
     handler.sendMessage(message);
   }
 }
Example #2
0
 private void sendReplyMessage(int id, Object arg) {
   Message message = Message.obtain(handler, id, arg);
   long resultDurationMS =
       getIntent()
           .getLongExtra(
               Intents.Scan.RESULT_DISPLAY_DURATION_MS, DEFAULT_INTENT_RESULT_DURATION_MS);
   if (resultDurationMS > 0L) {
     handler.sendMessageDelayed(message, resultDurationMS);
   } else {
     handler.sendMessage(message);
   }
 }
 private void decodeOrStoreSavedBitmap(Bitmap bitmap, Result result) {
   // Bitmap isn't used yet -- will be used soon
   if (handler == null) {
     savedResultToShow = result;
   } else {
     if (result != null) {
       savedResultToShow = result;
     }
     if (savedResultToShow != null) {
       Message message = Message.obtain(handler, R.id.decode_succeeded, savedResultToShow);
       handler.sendMessage(message);
     }
     savedResultToShow = null;
   }
 }