转载请注明出处:http://blog.csdn.net/guxiao1201/article/details/40708775
Activity public boolean isChangingConfigurations ()
- 常用于屏幕方法改变时的逻辑处理,但我还没用到过,所以详细介绍还是挪步到
Activity.isChangingConfigurations()
Check to see whether this activity is in the process of being destroyed in order to be recreated with a new configuration. This is often used in onStop()
to determine whether the state needs to be cleaned up or will be passed on to the next instance of the activity via onRetainNonConfigurationInstance()
.
Returns
- If the activity is being torn down in order to be recreated with a new configuration, returns true; else returns false.
ViewTreeObserver
- 可以注册监听正在屏幕上显示的视图树中任何视图状态的变化,我经常用来视图初始化完成后获取某个控件的尺寸。
A view tree observer is used to register listeners that can be notified of global changes in the view tree. Such global events include, but are not limited to, layout of the whole tree, beginning of the drawing pass, touch mode change.... A ViewTreeObserver should never be instantiated by applications as it is provided by the views hierarchy. Refer to getViewTreeObserver()
for more information.
DatabaseUtils
- 一个包装了一系列数据库操作方法的工具类(不过我没用过,还是喜欢手动敲sql)
android:weightSum
- 如果想实现一个Button,宽度占据屏幕宽度的50%怎么办?代码动态计算?尝试结合使用android:weightSum和android:layout_weight吧。参考博客:合用weightSum属性和layout_weight属性
Defines the maximum weight sum. If unspecified, the sum is computed by adding the layout_weight of all of the children. This can be used for instance to give a single child 50% of the total available space by giving it a layout_we