欢迎大家在这里学习ListPreference组件下面是我们给大家整理出来的精彩内容。希望大家在这里学习! 在res/array中先写两个数组,一个用与list的显示内容,一个用户list的选中数值。
复制代码
ListPreference点击后会弹出一个列表框,选中后会将选中的内容(上面数组中的值)会以字符串的的形式储存在SharedPreferences中。
xmlns:android="http://schemas.android.com/apk/res/android">
android:key="list_0"
android:title="登录设置A"
android:dialogTitle="选择在线时间"
android:entries="@array/auto_logout_time_key"
android:entryValues="@array/auto_logout_time_value" >
android:key="list_0"
android:title="登录设置A"
android:dialogTitle="选择在线时间"
android:entries="@array/auto_logout_time_key"
android:entryValues="@array/auto_logout_time_value" >
好了,ListPreference组件内容就给大家介绍到这里了。希望大家继续关注我们的网站!
相关推荐:
EditTextPreference组件使用方法