public class PreferenceActivityTest extends PreferenceActivity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);                  //The method addPreferencesFromResource(int) from the type PreferenceActivity is deprecated
addPreferencesFromResource(R.xml.preferences);
}
}其中addPreferencesFromResource过期了
我想知道需要将其替换成哪一个Method。或者其他解决办法。

解决方案 »

  1.   

    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.也就是说,现在推荐用PreferenceFragment类了,因此没有在PrefernceActivity类中列出替代方法。