0

I'm working with Android Studio and met a deprecated method: addPreferencesFromResource (R.xml.settings). Inizialmento I removed the deprecation and gives me the error can not resolve symbol 'xml'.

I wanted to know if:

  • If you set the method addPreferencesFromResource again deprecated
  • How can I use the method addPreferencesFromResource if it is deprecated?
Alberto Deidda
  • 506
  • 1
  • 4
  • 13
  • See this : http://stackoverflow.com/questions/16374492/alternative-to-addpreferencesfromresource-as-its-deprecated – Blaze Tama Oct 30 '14 at 16:06

1 Answers1

0

Instead of using a PreferenceActivity's addPreferencesFromResource, it's recommended that you use an Activity with PreferenceFragments.

PreferenceFragments also have a addPreferencesFromResource method that is not depricated.

The official documentation has a nice page describing this: http://developer.android.com/reference/android/preference/PreferenceActivity.html

You can also get example code by using Android Studio / Eclipse ADT's "New Activity" dialog, and then choosing a PreferenceActivity.

Victor KP
  • 437
  • 3
  • 10