From 18e79744390186052dd7e1867521aadd751e3cd0 Mon Sep 17 00:00:00 2001 From: Roc Boronat Date: Mon, 5 Jul 2021 14:19:10 +0200 Subject: [PATCH] Wrap the code that mocks the camera with a try-catch clause (#375) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bernat BorrĂ¡s Paronella --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0cc59084..69bcbc36 100644 --- a/README.md +++ b/README.md @@ -393,10 +393,13 @@ Mocking the Android Camera Intent is a tricky thing to do. To accomplish it in n Here's an example to copy paste: ```java -Intents.init(); -mockAndroidCamera(); -clickOn(R.id.launch_camera); -Intents.release(); +try { + Intents.init(); + BaristaIntents.mockAndroidCamera(); + clickOn(R.id.launch_camera); +} finally { + Intents.release(); +} ``` ## Runtime Permissions