findPreference 的替代方法

Alternative method for findPreference

应该调用什么方法而不是 findPreference,因为该方法已被弃用? example code

这是使用 PreferenceActivity 托管首选项的整个方法已被弃用。您应该使用 PreferenceFragment。有关详细信息,请参阅 `PreferenceActivity' docs

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.