2016.08.17
use PrefremceFragment when you only got one page of settings to show and you're currently supporting Andorid 3.0+.
See also:
https://developer.android.com/guide/topics/ui/settings.html#Fragment
- Create a Fragment extends PrefremceFragment
public static class SettingsFragment extends PreferenceFragment {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Load the preferences from an XML resource
addPreferencesFromResource(R.xml.preferences);
}
...
}
-
Start this Fragment from any Activity or build a SettingActivty for this.
-
If you want to digging more about Settings, see following links: