Settings must be saved in the default file.
To access, use PreferenceManager#getDefaultSharedPreferences()
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences (context);
context - any valid Context, including actions.
From the documentation for PreferenceFragment :
To get an instance of SharedPreferences, the hierarchy preference in this fragment will be used, call getDefaultSharedPreferences (android.content.Context) with the context in the same package as this fragment.
source share