Search in sources :

Example 11 with SharedPreferences

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);
}
Also used : Context(android.content.Context) SharedPreferences(android.content.SharedPreferences)

Example 12 with SharedPreferences

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();
}
Also used : Context(android.content.Context) SharedPreferences(android.content.SharedPreferences)

Example 13 with SharedPreferences

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();
}
Also used : Context(android.content.Context) SharedPreferences(android.content.SharedPreferences)

Example 14 with SharedPreferences

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);
    }
}
Also used : SharedPreferences(android.content.SharedPreferences)

Example 15 with SharedPreferences

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));
}
Also used : SharedPreferences(android.content.SharedPreferences) TextView(android.widget.TextView)

Aggregations

SharedPreferences (android.content.SharedPreferences)1653 Intent (android.content.Intent)206 View (android.view.View)101 Editor (android.content.SharedPreferences.Editor)100 TextView (android.widget.TextView)64 Context (android.content.Context)56 File (java.io.File)56 PendingIntent (android.app.PendingIntent)55 IOException (java.io.IOException)55 ArrayList (java.util.ArrayList)52 Bundle (android.os.Bundle)40 JSONObject (org.json.JSONObject)40 JSONException (org.json.JSONException)39 DialogInterface (android.content.DialogInterface)37 SuppressLint (android.annotation.SuppressLint)33 AdapterView (android.widget.AdapterView)32 ImageView (android.widget.ImageView)32 ListView (android.widget.ListView)32 ComponentName (android.content.ComponentName)31 AlertDialog (android.app.AlertDialog)26