title: run google mlkit text recognition synchronously
body: <p>I'm using google's mlkit in order to do text recognition, i need this to be sync and not async
  i tried adding the following, without any successes, any suggestions?</p>
  <pre><code>Thread thread = new Thread() {
      @Override
      public void run() {
          try {
              Tasks.await(result);
          } catch (ExecutionException e) {
              e.printStackTrace();
          } catch (InterruptedException e) {
              e.printStackTrace();
          }
      }
  };
      InputImage image = InputImage.fromBitmap(processedImageOfROI, 0);
      TextRecognizer recognizer = TextRecognition.getClient();
      Task&lt;Text&gt; result =
              recognizer.process(image)
                      .addOnSuccessListener(new OnSuccessListener&lt;Text&gt;() {
                          @Override
                          public void onSuccess(Text visionText) {
                              handleTextRecognizerResult(visionText);
                              Log.e(&quot;Text recognition&quot;, &quot;Successfully to detected text&quot;);
                          }
                      })
                      .addOnFailureListener(
                              new OnFailureListener() {
                                  @Override
                                  public void onFailure(@NonNull Exception e) {
                                      Log.e(&quot;Text recognition&quot;, &quot;Failed to detect text&quot;);
                                  }
                              });
  </code></pre>