Closed GoogleCodeExporter closed 9 years ago
The activity gets destroyed and re-created upon rotation, so you're holding on
to a stale object.
After the rotation, try using ActivityLifecyleMonitor to aquire the currently
resumed activity:
https://code.google.com/p/android-test-kit/source/browse/testrunner/src/main/jav
a/com/google/android/apps/common/testing/testrunner/ActivityLifecycleMonitor.jav
a#89
Here's an example of how it's done:
https://code.google.com/p/android-test-kit/source/browse/espresso/lib/src/main/j
ava/com/google/android/apps/common/testing/ui/espresso/base/RootViewPicker.java#
153
Original comment by vale...@google.com
on 9 Jun 2014 at 9:52
[deleted comment]
Somewhat related, here is a custom ViewAction I created for making this
simpler, in case people stumble upon this when looking for how to do change
orientation:
https://gist.github.com/nbarraille/03e8910dc1d415ed9740
Original comment by nathan.b...@gmail.com
on 9 Mar 2015 at 7:14
Original issue reported on code.google.com by
zboa...@gmail.com
on 2 Jun 2014 at 10:07