Preference Screen 首选项

 设置Preference Screen
(res\xml\userpreferences.xml)
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
<CheckBoxPreference
android:defaultValue="true"
android:key="PREF_VIBRATE"
android:title="VIBRATE" /> <Preference
android:key="button"
android:title="Rimind Distance" /> </PreferenceScreen>

(UserPreferenceFragment.java)

addPreferencesFromResource(R.xml.userpreferences);

(FragmentPreferences.java)

getFragmentManager().beginTransaction().replace(android.R.id.content, new UserPreferenceFragment())
.commit();
上一篇:关注下Swoole


下一篇:自动化构建工具gradle安装教程(使用sdkman安装)