Upgrade to Pro — share decks privately, control downloads, hide ads and more …

12. Меню и Настройки

12. Меню и Настройки

Evgeny Shishkin

February 26, 2015
Tweet

More Decks by Evgeny Shishkin

Other Decks in Education

Transcript

  1. SharedPreferences • getBoolean(String key, boolean defValue); • getFloat(String key, float

    defValue); • getInt(String key, int defValue); • getLong(String key, long defValue); • getString(String key, String defValue)
  2. SharedPreferences String checkboxKey = "checkbox"; SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); boolean

    isChecked = prefs.getBoolean(checkboxKey, false); String checkboxKey = "checkbox"; SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); SharedPreferences.Editor editor = prefs.edit(); editor.putBoolean(checkboxKey, true); editor.commit(); Read Write