Android SharedPreferences Save putPrefBoolean(Context c, String key, boolean value)

Here you can find the source of putPrefBoolean(Context c, String key, boolean value)

Description

put Pref Boolean

Declaration

public static void putPrefBoolean(Context c, String key, boolean value) 

Method Source Code

//package com.java2s;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

public class Main {
    public static void putPrefBoolean(Context c, String key, boolean value) {
        SharedPreferences sp = PreferenceManager
                .getDefaultSharedPreferences(c);
        sp.edit().putBoolean(key, value).commit();
    }//from   ww  w. j av  a2s . c  o  m
}

Related

  1. putSharedPrefs(Context context, String prefName, int mode, Map pairs)
  2. saveSetting(Context context, String name, Long value)
  3. saveSetting(Context context, String name, String value)
  4. updatePrefValueByModel(SharedPreferences pref, String key, String thisModel, String targetModel, Object targetModelValue, Object notTargetModelValue)
  5. setSharedPreferences(String key, String value, Context context)
  6. putPrefInt(Context c, String key, int value)