android横屏切换不销毁-Handling the Configuration Change Yourself
16lz
2021-01-23
做了一段时间的系统开发后,深深的发觉自己的基础知识忘记了好多
,开始猛看developer.android.com/。
无意发现了原来可以设置横屏切换不destroy和onStart的设置
for example:
上面解释说:
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。
自定义处理配置改变?
,开始猛看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。
自定义处理配置改变?
更多相关文章
- android摇一摇功能实现
- Android记事本NotePad应用功能拓展(五)
- android中自动提示、补全、连接的功能实现
- 【Android-View】基于原生View的简单功能定制
- android 学习笔记3--静默安装功能的实现
- Android 基础知识复习
- Android 拨打电话功能