title: uiautomator dump returns dump of previous screen
body: <p>I'm trying to use appium to test a 3rd party app. While checking for the presence of an element on the screen, appium is unable to find the element even though it is present on the screen.</p>
  
  <p>Tried the following things as part of root causing: <br/>
  1. Getting page xml hierarchy using Appium drive getpageSource(). This returns the xml dump of the previous screen<br/>
  2. Getting page xml hierarchy using Android's uiautomator dump. This also returns the same as the appium output.</p>
  
  <p>Other observations:<br/>
  1. This behaviour is not consistent. Sometimes, the element is found. At other times, it is not.<br/>
  2. When I try inspecting the hierarchy through the hierarchyviewer, the xml dump is of the current page and not the previous one. This almost indicates that the hierarchy viewer gets the xml dump in a way that is different from uiautomator.</p>
  
  <p>Any clues on how I can fix this?</p>
  
  <p>Thanks,
  Aarthi</p>