@@ -82,6 +82,7 @@ public class Solo {
82
82
private final Waiter waiter ;
83
83
private final Setter setter ;
84
84
private final Instrumentation instrumentation ;
85
+ private final int TIMEOUT = 20000 ;
85
86
public final static int LANDSCAPE = ActivityInfo .SCREEN_ORIENTATION_LANDSCAPE ; // 0
86
87
public final static int PORTRAIT = ActivityInfo .SCREEN_ORIENTATION_PORTRAIT ; // 1
87
88
public final static int RIGHT = KeyEvent .KEYCODE_DPAD_RIGHT ;
@@ -276,7 +277,7 @@ public boolean waitForText(String text, int minimumNumberOfMatches, long timeout
276
277
277
278
public <T extends View > boolean waitForView (final Class <T > viewClass ){
278
279
279
- return waiter .waitForView (viewClass , 0 , 20000 , true );
280
+ return waiter .waitForView (viewClass , 0 , TIMEOUT , true );
280
281
}
281
282
282
283
/**
@@ -1825,14 +1826,26 @@ public void goBackToActivity(String name)
1825
1826
}
1826
1827
1827
1828
/**
1828
- * Waits for the given Activity.
1829
+ * Waits for the given {@link Activity}. Default timeout is 20 seconds.
1830
+ *
1831
+ * @param name the name of the {@code Activity} to wait for e.g. {@code "MyActivity"}
1832
+ * @return {@code true} if {@code Activity} appears before the timeout and {@code false} if it does not
1833
+ *
1834
+ */
1835
+
1836
+ public boolean waitForActivity (String name ){
1837
+ return waiter .waitForActivity (name , TIMEOUT );
1838
+ }
1839
+
1840
+ /**
1841
+ * Waits for the given Activity.
1829
1842
*
1830
1843
* @param name the name of the {@link Activity} to wait for e.g. {@code "MyActivity"}
1831
1844
* @param timeout the amount of time in milliseconds to wait
1832
1845
* @return {@code true} if {@link Activity} appears before the timeout and {@code false} if it does not
1833
1846
*
1834
1847
*/
1835
-
1848
+
1836
1849
public boolean waitForActivity (String name , int timeout )
1837
1850
{
1838
1851
return waiter .waitForActivity (name , timeout );
0 commit comments