I’m wanting to use android:configChanges="orientation|keyboardHidden" for a few of my activities so that my onCreate doesn’t get called again, but I thought I’d see if anyone had a list of pros and cons first because this link says that it should only be used as a last resort.
I’m wanting to use android:configChanges=orientation|keyboardHidden for a few of my activities so that my
Share
A big Pro of using this approach is that it requires very little effort on your part, and that your app will survive config changes without resorting to crashes.
The small drawback is that using configuration specific resources (for landscape or portrait orientation) don’t get applied automatically.
In my (perhaps little) experience, I think its not really worth the effort to do all the plumbing.
“Proper” handling of these config changes requires a lot of plumbing on your part, and things get even more dramatic if you have to support progress dialogs during screen orientation changes.
Although most people will opt for the quick fix by changing the manifest, and configuring their activity with android:configChanges=”keyboardHidden|orientation”, I think it’s important to realize that there are alternatives to this.
It requires more code, but it does give you better insight in how the overall system works.