PreferenceScreen1
转载
package com.example.app;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.view.Menu;
import android.view.MenuItem;
public class MainActivity extends PreferenceActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//加载第一个布局
addPreferencesFromResource(R.layout.activity_main);
}
}
配置文件
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:key="using_categories_in_root_screen"
android:summary="Using Preference Categories"
android:title="Categories" >
<PreferenceCategory
android:key="meats_screen"
android:summary="Preferences related to Meats"
android:title="肉类" >
<CheckBoxPreference
android:key="fish_selection_pref"
android:summary="小心扎嗓子"
android:title="鱼" />
<CheckBoxPreference
android:key="lamb_selection_pref"
android:summary="小肥羊吃多了不好"
android:title="羊肉" />
<CheckBoxPreference
android:key="chicken_selection_pref"
android:summary="营养价值不够高"
android:title="鸡肉" />
</PreferenceCategory>
<PreferenceCategory
android:key="vegi_screen"
android:summary="Preferences related to vegetable"
android:title="蔬菜类" >
<CheckBoxPreference
android:key="tomato_selection_pref"
android:summary="西红柿可以炒鸡蛋⊙﹏⊙"
android:title="西红柿" />
<CheckBoxPreference
android:key="xilanhua_selection_pref"
android:summary="营养价值很丰富"
android:title="西兰花" />
</PreferenceCategory>
</PreferenceScreen>
PreferenceScreen1相关推荐
- Preference的使用(2) --- PreferenceCategory PreferenceScreen
上一节有讲到Preference的基本使用跟API的介绍 ,没有看的话请先阅读 Preference的使用(1) 现在介绍其子类PreferenceCategory 跟 PreferenceScre ...
最新文章
- 基于人工神经网络的不规则小天体引力场建模
- 谋定数字农业生态系统 万亿市场对话中国农民丰收节交易会
- 串口光猫应用领域及技术参数详解
- php 堵塞 消息队列,PHP的并发处理
- TimeSpan 用法 求离最近发表时间的函数
- ngnix学习(二)ngnix常用命令
- php伪随机数 ctf,[GWCTF 2019]枯燥的抽奖
- codeforces 340E Iahub and Permutations(错排or容斥)
- 视频显示器与服务器之间使用什么线连接,显示器连接线有哪些?四种主流连线科普。...
- 移动端产品比较分析:APP、小程序、H5
- 整人代码好玩到没朋友
- 视频一键识别生成字幕
- 张轩睿和Selina要复合?任家萱的粉丝们会同意吗
- HTTP 错误 404.3 – Not Found 由于扩展配置问题而无法提供您请求的页面。如果该页面是脚本,请添加处理程序。如果应下载文件,请添加 MIME 映射。
- Telsa显卡时间轴
- 腾讯云服务器计费模式包年包月/按量计费/竞价实例选择困难户
- 非极大值抑制(non-maximum suppression)的理解
- 未来科学技十幻想画计算机,未来世界科幻画图片 你憧憬过这样的未来吗
- 关于“产品驱动”和“技术驱动”
- linux系统有哪些版本 linux系统哪个版本好用