Make sure that onAttachedToWindow and onDetachedToWindow is called in the
correct order. The ViewAttachTestActivity contains a view that will throw
a RuntimeException if onDetachedToWindow and onAttachedToWindow are
called in the wrong order.
1. Initiate the activity 2. Perform a series of orientation changes to
the activity (this will force the View hierarchy to be rebuilt,
generating onAttachedToWindow and onDetachedToWindow)
Expected result: No RuntimeException is thrown from the TestView in
ViewFlipperTestActivity.
final ViewAttachTestActivity activity = getActivity();
for (int i = 0; i < 20; i++) {
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
SystemClock.sleep(250);
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
SystemClock.sleep(250);
}