Search code examples
androidpreferenceactivity

Alternative method for findPreference


What method should be called instead of findPreference since that method is deprecated? example code


Solution

  • It's that the entire method of using PreferenceActivity to host preferences is deprecated. You should be using PreferenceFragment. See `PreferenceActivity' docs for details.

    This is the base class for an activity to show a hierarchy of preferences to the user. Prior to HONEYCOMB this class only allowed the display of a single set of preference; this functionality should now be found in the new PreferenceFragment class. If you are using PreferenceActivity in its old mode, the documentation there applies to the deprecated APIs here.