I access it like this
This is great if you do not plan to use PreferenceActivity .
I implemented PreferenceActivity so that users can change values through it
Unfortunately.
Also get rid of getApplicationContext() there if you have no specific reason to use Application , and not an action / service / something else. Use only the Application object when you need it and you know why you need it.
Is it possible to get PreferenceActivity to work with my MyPrefs settings?
Not easy. Unless you have a specific reason to come up with your own SharedPreferences file, I would use it by default.
And what's the point of having multiple preferences in one application?
You may have a library or reusable component that wants to store things in SharedPreferences , and this may have its own file so as not to spoil any hosting preferences. This usually does not require multiple preference files.
CommonsWare
source share