Skip to content

Instantly share code, notes, and snippets.

View idish's full-sized avatar

Idan Ben Shalom idish

View GitHub Profile
abstract class SharedPreferenceLiveData<T> extends LiveData<T> {
SharedPreferences sharedPrefs;
String key;
T defValue;
public SharedPreferenceLiveData(SharedPreferences prefs, String key, T defValue) {
this.sharedPrefs = prefs;
this.key = key;
this.defValue = defValue;