Reputation: 41510
Given that any non-null context passed to PreferenceManager.getDefaultSharedPreferences will return the same result, what is context used for by PreferenceManager and what's the point of passing in different context?
Upvotes: 1
Views: 672
Reputation: 1007544
what is context used for by PreferenceManager
To get at the locations of internal storage and, IIRC, the package name of the app.
what's the point of passing in different context?
In general, any Context
will do for this method call. In principle, you could pass in some ContextWrapper
that overrides something that would be used by getDefaultSharedPreferences()
.
Upvotes: 3