机器人:configChanges选项-Android [英] android:configChanges option -Android

查看:161
本文介绍了机器人:configChanges选项-Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道我们可以在下面的值设置到Android:configChanges

I know we can set the following value to the android:configChanges

mcc 
mnc    
touchScreen
keyboardHidden
orientation,etc.

有时我们这个投身其中 | 运营商,但我很困惑的是他们通过加入他们的意思。什么样的变化来..?请清除我的困惑。

and sometimes we join them by this | operator but i am very confused what is the meaning of them by joining them. What changes come..? Please clear my confusion.

和还您是如何知道使用 | 这个操作符与哪些选项恰好

and also how do u know that by using | this operator what happens with the option?

推荐答案

在更改配置在运行时,该活动被关闭,默认情况下重新启动,但在宣布这些类型属性的配置将prevent活动从正在重新启动。

When a configuration change occurs at runtime, the activity is shut down and restarted by default, but declaring a configuration with these type attribute will prevent the activity from being restarted.

例如,当你声明的选项:|在清单文件(安卓configChanges =方向keyboardHidden

For Instance, When you declare the option(android:configChanges="orientation|keyboardHidden") in your Manifest file


  1. 方向,声明的配置与此属性将prevent活动被restarted.In其他情况下,你是通知到Android你有分离的布局有当布局变化happens.So您的活动将移除的部件和值的所有引用存储previously要绘制,并与被景观专门设计布局文件重新创建,如果任何系统。这显示之前的布局方向偏偏可以通过的onSaveInstanceState onRestoreInstanceState

  1. "orientation", Declaring a configuration with this attribute will prevent the activity from being restarted.In other case,you are informing to the android system that you have separate layout that has to be drawn when the layout change happens.So your activity will remove all the references of the widgets and values stored previously and recreates with the layout file that is designed specifically for landscape, if any. All the values that are shown before the layout orientation happens can be saved and restored through onSaveInstanceState and onRestoreInstanceState

keyboardHidden,隐藏键盘

希望,这些点至少会帮助你一点。

Hope, these points would help you a little at least.

我会尝试在这个主题增添更多的积分。

I will try add more points on this topic.

干杯

这篇关于机器人:configChanges选项-Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆