Default pref: make sure to use app context

This commit is contained in:
ganfra 2020-09-08 15:43:32 +02:00 committed by Benoit Marty
parent c2880a5832
commit dc04d2848d

View File

@ -26,6 +26,6 @@ object DefaultSharedPreferences {
fun getInstance(context: Context): SharedPreferences = fun getInstance(context: Context): SharedPreferences =
INSTANCE ?: synchronized(this) { INSTANCE ?: synchronized(this) {
INSTANCE ?: PreferenceManager.getDefaultSharedPreferences(context).also { INSTANCE = it } INSTANCE ?: PreferenceManager.getDefaultSharedPreferences(context.applicationContext).also { INSTANCE = it }
} }
} }