public void waitForHintText ( String hintText , int timeout ) throws Exception { int RETRY_PERIOD = 250 ; int retryNum = timeout / RETRY_PERIOD ; for ( int i = 0 ; i < retryNum ; i ++ ) { ArrayList < View > imageViews = getCustomViews ( "EditText" ) ; for ( View v : imageViews ) { if ( ( ( EditText ) v ) . getHint ( ) == null ) continue ; if ( ( ( EditText ) v ) . getHint ( ) . equals ( hintText ) && v . getVisibility ( ) == View . VISIBLE ) return ; } this . sleep ( RETRY_PERIOD ) ; } throw new Exception ( String . format ( "Splash screen didn't disappear after %d ms" , timeout ) ) ; }
Waits for hint text to appear in an EditText