Allow to regenerate shared preferences

Merge of r326 to trunk
This commit is contained in:
Markus Doits 2010-12-30 13:47:10 +00:00
parent 1edac5a61e
commit 86e06eeabe

View File

@ -12,9 +12,13 @@ public class Preferences {
private static Preferences mPreferences;
private SharedPreferences mSharedPreferences;
public static synchronized Preferences getPreferences(Context context)
public static synchronized Preferences getPreferences(Context context) {
return getPreferences(context, false);
}
public static synchronized Preferences getPreferences(Context context, boolean force_new)
{
if (mPreferences == null) {
if (mPreferences == null || force_new) {
mPreferences = new Preferences(context);
}
return mPreferences;