use of android.content.SharedPreferences in project coinbase-bitmonet-sdk by coinbase.
the class UserProfileSettings method retrieveBooleanPreference.
private Boolean retrieveBooleanPreference(String key) {
Context context = Bitmonet.getBitmonetContext();
SharedPreferences sharedPreferences = context.getSharedPreferences(Constants.BITMONET_SHARED_PREFERENCE, Context.MODE_PRIVATE);
return sharedPreferences.getBoolean(key, false);
}
use of android.content.SharedPreferences in project coinbase-bitmonet-sdk by coinbase.
the class UserProfileSettings method saveStringPreference.
private void saveStringPreference(String key, String value) {
Context context = Bitmonet.getBitmonetContext();
SharedPreferences sharedPreferences = context.getSharedPreferences(Constants.BITMONET_SHARED_PREFERENCE, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putString(key, value);
editor.commit();
}
use of android.content.SharedPreferences in project coinbase-bitmonet-sdk by coinbase.
the class UserProfileSettings method saveLongPreference.
private void saveLongPreference(String key, long value) {
Context context = Bitmonet.getBitmonetContext();
SharedPreferences sharedPreferences = context.getSharedPreferences(Constants.BITMONET_SHARED_PREFERENCE, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putLong(key, value);
editor.commit();
}
use of android.content.SharedPreferences in project Launcher3 by chislon.
the class LauncherTransitionable method toggleShowWeightWatcher.
private void toggleShowWeightWatcher() {
String spKey = LauncherAppState.getSharedPreferencesKey();
SharedPreferences sp = getSharedPreferences(spKey, Context.MODE_PRIVATE);
boolean show = sp.getBoolean(SHOW_WEIGHT_WATCHER, true);
show = !show;
SharedPreferences.Editor editor = sp.edit();
editor.putBoolean(SHOW_WEIGHT_WATCHER, show);
editor.commit();
if (mWeightWatcher != null) {
mWeightWatcher.setVisibility(show ? View.VISIBLE : View.GONE);
}
}
use of android.content.SharedPreferences in project cw-omnibus by commonsguy.
the class PrefsPersistActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
int counter = prefs.getInt(KEY, 0);
((TextView) findViewById(R.id.value)).setText(String.valueOf(counter));
AbstractPrefsPersistStrategy.persist(prefs.edit().putInt(KEY, counter + 1));
}
Aggregations