From c8d03ee1162748387b40c2225944965b664dac0c Mon Sep 17 00:00:00 2001 From: Mattia Iavarone Date: Thu, 29 Aug 2019 12:31:35 +0200 Subject: [PATCH] Update 2018-12-20-frame-processing.md --- docs/_posts/2018-12-20-frame-processing.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/_posts/2018-12-20-frame-processing.md b/docs/_posts/2018-12-20-frame-processing.md index 864f441e..1f1e463b 100644 --- a/docs/_posts/2018-12-20-frame-processing.md +++ b/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.