android4.2.2 Settings

 

出自 :http://blog.csdn.net/abc137508277/article/details/8878885

Setting分析

Setting的启动要从setting.java中分析。为topactivity extends PreferenceActivity

PreferenceActivity英语文档

This activityshows one or more headers of preferences, each of which is associated with a PreferenceFragment to display the preferences of that header. The actuallayout and display of these associations can however vary; currently there aretwo major approaches it may take:

·        On a small screen it may display only the headers as asingle list when first launched. Selecting one of the header items willre-launch the activity with it only showing the PreferenceFragment of thatheader.

·        On a large screen in may display both the headers andcurrent PreferenceFragment together as panes. Selecting a header item switchesto showing the correct PreferenceFragment for that item.

以上意思翻译过来就是说,preferrenceActivity可以显示1个或者多个header。每个header都是以PreferenceFragment显示。

PreferenceActivity显示也分两种,

一种是在小的屏幕上,或者低分辨率设备上,只显示header部分。点击header进入fragment。

另外一种是在大的屏幕上或者高分辨率设备上,header和fragment同时显示,左侧是header,右侧是fragment.

在onBuildHeaders加载主界面

loadHeadersFromResource(R.xml.settings_headers,headers);
其中addPreferencesFromResource methodwas deprecated in API level 11
各个fragment是依附于subsetting的,由subsetting统一管理各个fragment。相当于一个activity在多个UI界面之间的切换。

其设置里面的Google Account有个location setting,这个东西是在GoogleServicesFramework.apk中添加的。没有源码,这个是google服务框架。

转载请注明出处,thanks!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值