PreferenceFragment - Difference between getPreferenceManager() and getPreferenceScreen()?

Posted by Zynga Liker on Stack Overflow See other posts from Stack Overflow or by Zynga Liker
Published on 2012-11-29T03:26:50Z Indexed on 2012/11/29 5:04 UTC
Read the original article Hit count: 125

I've implemented my own PreferenceFragment subclass (detailed here), and want to listen for preference changes within it. PreferenceFragment provides you with two ways of doing this:

getPreferenceManager().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);

and

getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);

Which one should be used? What's the difference? I don't really understand the distinction made in the Android docs.

© Stack Overflow or respective owner

Related posts about android

Related posts about sharedpreferences