My first attempt at preferences was without knowledge of PreferenceActivity
. So now I have an app that stores all user preferences in a specific preference file. >
It may be too late to post this but you can find a nice solution here
You set the name of the default shared preferences file beforehand like this:
public class MyPreferencesActivity extends PreferenceActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
PreferenceManager prefMgr = getPreferenceManager();
prefMgr.setSharedPreferencesName("my_preferences");
prefMgr.setSharedPreferencesMode(MODE_WORLD_READABLE);
addPreferencesFromResource(R.xml.preferences);
}
}
I hope this helps somebody.
Regards.