diff --git a/src/androidTest/java/com/owncloud/android/ui/activity/FileDisplayActivityTest.java b/src/androidTest/java/com/owncloud/android/ui/activity/FileDisplayActivityTest.java index 0131c8f83e..e024a04ab3 100644 --- a/src/androidTest/java/com/owncloud/android/ui/activity/FileDisplayActivityTest.java +++ b/src/androidTest/java/com/owncloud/android/ui/activity/FileDisplayActivityTest.java @@ -23,6 +23,7 @@ public class FileDisplayActivityTest extends AbstractIT { @Test public void testSetupToolbar() { try (ActivityScenario scenario = ActivityScenario.launch(FileDisplayActivity.class)) { + InstrumentationRegistry.getInstrumentation().waitForIdleSync(); InstrumentationRegistry.getInstrumentation().runOnMainSync(() -> { Activity activity = ActivityLifecycleMonitorRegistry.getInstance().getActivitiesInStage(RESUMED).iterator().next();