How to add Preference in ICS using addPreferencesFromResource()?
It is shown deprecated in ics. i’ve added a preference layout in xml folder.. but this could not be added to the Preference activity..
How to add Preference in ICS using addPreferencesFromResource()? It is shown deprecated in ics.
Share
From HC/ICS onward you should use
PreferenceFragment.addPreferencesFromResource()instead ofActivity.addPreferencesFromResource(). However, this does require you switch how your preference code is structured – moving from an old stylePreferenceActivitywhich directly adds the preferences to a new stylePreferenceActivitythat loads PreferenceFragments that then load the preferences. For an example of the new way, see the code sample in thePreferenceActivitydocs.Note that the support library does not PreferenceFragment for backward compatibility pre-HC.