@Override
  protected void onPostExecute(Boolean result) {
    super.onPostExecute(result);

    Handler handler = activity.getHandler();
    if (handler != null) {
      // Send results for single-shot mode recognition.
      if (result) {
        Message message = Message.obtain(handler, R.id.ocr_decode_succeeded, ocrResult);
        message.sendToTarget();
      } else {
        Message message = Message.obtain(handler, R.id.ocr_decode_failed, ocrResult);
        message.sendToTarget();
      }
      activity.getProgressDialog().dismiss();
    }
    if (baseApi != null) {
      baseApi.clear();
    }
  }
Class to send OCR requests to the OCR engine in a separate thread, send a success/failure message,
and dismiss the indeterminate progress dialog box. Used for non-continuous mode OCR only.
OCRTest/src/main/java/edu/sfsu/cs/orange/ocr/OcrRecognizeAsyncTask.java