android - Can I use my current SharedPreferences tag to store the values from a PreferenceActivity? -
Currently, I want to store application level variables and move value among my all activities in my app The activities using the following code in the
prefs = this.getSharedPreferences ("MyPrefs", Context.MODE_PRIVATE);
I had no prioritization before, but now I do and I am trying to store some user prefoms in the "Myofrefs" with the same shared priority tag.
I know that I can use PreferenceActivity SharedPrefs from my activities
prefs = PreferenceManager.getDefaultSharedPreferences (this);
But I would like to save those values in my current shared private tag, "MipFrends", but I'm not sure how to do this.
Thanks in advance. You can not preferneceManager always this.getPackageName () + name as the priority name " + Preferences ". Sorry to break bad news. It is also important when you want to use it.
You definitely change MyPrefs with this.getPackageName () + "_preferences .
Comments
Post a Comment