Settings

Settings can be stored using

SharedPreferences settings;
settings = PreferenceManager.getDefaultSharedPreferences(context);

This will access settings stored for the context which is typically an Activity! To share settings cross Activities use context.getApplicationContext() instead of context. This will share the data,

settings = PreferenceManager.getDefaultSharedPreferences(context.getApplicationContext());

Leave a Reply

Your email address will not be published. Required fields are marked *