string with a "0", but it's always empty when I test it. I have included

PreferenceManager.setDefaultValues(this, R.xml.preferences, false);

in onCreate in my MainActivity, so the default values should be set.

I'm not sure which of these methods I should be using since I have multiple resource files for my settings, but none of them seem to be working for me. In the case of

getSharedPreferences(name, MODE_PRIVATE)

, I have no idea what the name parameter should be referencing, since I've never named my shared preferences file.

EDIT: It turns out my issue was not related to getting values from the shared preferences file. I just had the wrong xml tag on the preference I was trying to check the value of. I changed it from a generic

Hey I have used AppCompat for my preference screen too.I did this because I wanted to use Vintage Chroma and this was the only way. But I am able to use PreferenceManager.getDefaultSharedPreference() without any errors.

Also if you want to use default shared preferences in the Fragment you can use :