I enabled onConfigChanges event and properly handling when device turns from portrait into lanscape. However, after onConfigChanges, when page is calculated again and finishes it, which event is fired? Thank you
I enabled onConfigChanges event and properly handling when device turns from portrait into lanscape.
Share
It says in the documentation “Some device configurations can change during runtime (such as screen orientation, keyboard availability, and language). When such a change occurs, Android restarts the running Activity (
onDestroy()is called, followed byonCreate()). The restart behavior is designed to help your application adapt to new configurations by automatically reloading your application with alternative resources that match the new device configuration.” [emphasis mine]However, if you handle the changes yourself the only method which gets called is
onConfigurationChanged(). Any changes you wish to make must be in this method, as none of the onX methods will be called. By handling the config changes yourself you’ve told it NOT to destroy and reload your app – thus, the page doesn’t actually get calculated again. The only things which happen are those which you define in theonConfigurationChanged()method.“Now, when one of these configurations change, MyActivity does not restart. Instead, the MyActivity receives a call to
onConfigurationChanged().”source: http://developer.android.com/guide/topics/resources/runtime-changes.html