Stack Overflow archive
3 score

findPreference(java.lang.CharSequence) is deprecated

score
3
question views
8.9K
license
CC BY-SA 3.0

It is deprecated because Android moved to fragment-based activities. Calling findPreference(CharSequence) will still work in higher API levels. You are just encouraged to use fragments instead of a PreferenceActivity.

The reason for the deprecation can be found in the source:

This function is not relevant for a modern fragment-based PreferenceActivity.


In API 11+ you should use PreferenceFragment.


If you want to have your IDE ignore the error just add the following to your method: @SuppressWarnings("deprecation")

Originally posted on Stack Overflow. Public user contributions are licensed under Creative Commons Attribution-ShareAlike.