I am building a tablet app in Android 3.0 that should always be displayed in landscape no matter what orientation the tablet is in. I pop up a dialog to the user on start up. When the tablet is locked in landscape, turned to portrait and unlocked, the app crashes. I have found that the issue is an IllegalStateException with a message “View not attached to window manager”. I have added into the manifest in the application tag:
android:configChanges="orientation"
and added into the activity:
public void onConfigurationChange() {}
The error is thrown on Dialog.dismiss().
Let me know if you need any more info. Thanks in advance.
Ok so we solved the problem. The tablet we are testing on is running 3.2. In 3.2 the android:configChanges attribute needs to also include screen size
within the manifest application tag.
This was helpful:
How do I disable orientation change on Android?