title: Providing delay between events in UiAutomator Android
body: <p>How can I provide delay between event clicks in UiAutomator Android.</p>
  
  <p>First event is entering a url in EditText :</p>
  
  <pre><code>new UiObject(new UiSelector().text("Search here")).setText("abc.com");
  getUiDevice.waitForIdle(15000); 
  </code></pre>
  
  <p>Here I am loading a webpage inside a webview. So when url loading finishes , then I need to check for second event.</p>
  
  <p>Second event is checking content description of a object :</p>
  
  <pre><code>UiObject curClass = new UiObject(new UiSelector().className("android.widget.RelativeLayout"));  
  UiObject yCur = curClass.getChild(new UiSelector().description("ye"));
  getCurCol();
  
  public void getCurCol() throws UiObjectNotFoundException {
  try {
      if (yCur.getContentDescription() != null)
          report.append("Success");
  } catch (Exception e) {
      System.err.println("\nCaught Exception: " + e.getMessage());
  }
  </code></pre>
  
  <p>But this doesn't seem to be working.</p>
  
  <p>I just want the app to wait for some time before checking for the second event.</p>
  
  <p>I know these three methods are provided for delay in UI Automator - </p>
  
  <pre><code>public void waitForIdle(long timeout)
  
  public void waitForIdle()
  
  public boolean waitForWindowUpdate(String packageName, long timeout)
  </code></pre>
  
  <p>But I don't know how to use these methods. </p>
  
  <p>Please suggest me a example how to use these.</p>
  
  <p>Any help would be appreciated.</p>
  
  <p>Thanks!</p>