Update 2018-12-20-frame-processing.md

pull/573/head
Mattia Iavarone 5 years ago committed by GitHub
parent eddae18caa
commit c8d03ee116
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      docs/_posts/2018-12-20-frame-processing.md

@ -57,7 +57,13 @@ public void process(@NonNull Frame frame) {
// EXAMPLE 1:
// Firebase and Google APIs will often return a Task.
// You can use Tasks.await() to complete the task on the current thread.
Tasks.await(firebaseDetector.detectInImage(firebaseImage));
// Read: https://developers.google.com/android/guides/tasks#blocking
try {
result = Tasks.await(firebaseDetector.detectInImage(firebaseImage));
catch (Exception e) {
// Firebase task failed.
}
// EXAMPLE 2:
// For other async consumers, you can use, for example, a CountDownLatch.

Loading…
Cancel
Save