android - Store and Get Application's Shared Preferences In Activities -
I want to save MainActivity in the shared preferences And get it from
MenuException I tried to do this:
Main Activity :
ISharedPreferences _prefs; ISharedPreferencesEditor Editor = _prefs.Edit (); Editor. Patstrings ("user", type); Editor.Apply (); MenuActivity :
ISharedPreferences _prefs = Application.Context.GetSharedPreferences ("user", FileCreationMode.Private); I think I'm not caching main activity in the shared preferences at the application level < P> Therefore, any ideas on how to store shared preferences globally?
OK, this has changed it:
ISharedPreferences _prefs = Application.Context.GetSharedPreferences ("User", FileCreationMode.Private); To do this:
ISharedPreferences _prefs = PreferenceManager.GetDefaultSharedPreferences (application.Context);
Comments
Post a Comment