android横屏切换不销毁-Handling the Configuration Change Yourself

做了一段时间的系统开发后,深深的发觉自己的基础知识忘记了好多
,开始猛看developer.android.com/。
无意发现了原来可以设置横屏切换不destroy和onStart的设置
for example:
<activity android:name=".MyActivity"
          android:configChanges="orientation|keyboardHidden"
          android:label="@string/app_name">

上面解释说:
Now, when one of these configurations change, MyActivity does not restart. Instead, the MyActivity receives a call to onConfigurationChanged().


onConfigurationChanged()来处理了,
整个功能叫 Handling the Configuration Change Yourself。
自定义处理配置改变?


猜你喜欢

转载自dengzhangtao.iteye.com/blog/1837494