设置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();

 

相关文章:

  • 2021-04-29
  • 2021-12-04
  • 2021-11-20
  • 2021-12-03
  • 2021-11-29
  • 2022-01-21
  • 2021-04-07
猜你喜欢
  • 2021-05-25
  • 2021-10-22
  • 2021-12-21
  • 2021-07-07
  • 2022-12-23
  • 2022-01-17
  • 2022-12-23
相关资源
相似解决方案