xiaocong / android-uiautomator-server

MIT License
169 stars 103 forks source link

waitForExists fails when changing Fragments #38

Open barkside opened 5 years ago

barkside commented 5 years ago

waitForExists works fine when I change activities, but if in the same activity, I animate out a fragment, and animate in a new fragment, I can't find any views in the new fragment. waitForExists times out.
waitForExists still works for views in the old fragment however, so it is like a window update has not occurred.

How do I make the internal node information in the UiAutomation, or the underlying Accessibility service update when these changes occur?

Failing that, how do I cause the cache to update quickly with a RPC call? dumpViewHierarchy works, but it takes too long. I assume ReflectionUtils.clearAccessibilityCache() is the thing that works here?

Are there any events I can listen too, similar to the toast notification listener thingy, to perform this clearAccessibilityCache automatically?