For settings I use
PreferenceActivity , on method
addPreferencesFromResource() ; Eclipse says that it is outdated and you need to use the
fragment . What is better to use in which case? Can I continue to use
Really specified method is deprecated, starting with API Level 11 - that is, with Android 3.0. Simultaneously, obsolete methods for creating dialogs such as
Activity.showDialog() have been declared obsolete, it is recommended to use fragments instead of them.
But there are a few significant points:
- Deprecation does not mean that the methods will not work - it means that the methods are replaced by other more new / stable / better. And perhaps in the future they will not work.
- Most Android devices still work on API Level <= 10, respectively, I would prefer to quietly continue to use obsolete methods with API 10.
Use to build the SDK Level 10 and the IDE will not swear at the obsolescence.
If you still want to use the SDK for ICS, then an example of using the PreferenceFragment here