@Test public void testSet() throws Exception { assertNull(mNullPref.get()); mNullPref.set(Boolean.TRUE); assertTrue(mNullPref.get()); assertFalse(mFalsePref.get()); mFalsePref.set(Boolean.FALSE); assertFalse(mFalsePref.get()); mFalsePref.set(Boolean.TRUE); assertTrue(mFalsePref.get()); assertTrue(mTruePref.get()); mTruePref.set(Boolean.TRUE); assertTrue(mTruePref.get()); mTruePref.set(Boolean.FALSE); assertFalse(mTruePref.get()); }
@Nullable @Override public Boolean get() { if (contains()) { return readSharedPreferences().getBoolean(getKey(), false); } else { return getDefaultValue(); } }
BooleanPreference extends Preference<Boolean> { @Nullable @Override public Boolean get() { if (contains()) { return readSharedPreferences().getBoolean(getKey(), false); } else { return getDefaultValue(); } } }
BooleanPreference extends Preference<Boolean> { @Nullable @Override public Boolean get() { if (contains()) { return readSharedPreferences().getBoolean(getKey(), false); } else { return getDefaultValue(); } } BooleanPreference(final String name, final String key,
            @Nullable final Boolean defaultValue); }
BooleanPreference extends Preference<Boolean> { @Nullable @Override public Boolean get() { if (contains()) { return readSharedPreferences().getBoolean(getKey(), false); } else { return getDefaultValue(); } } BooleanPreference(final String name, final String key,
            @Nullable final Boolean defaultValue); @Override boolean exists(); @Nullable @Override Boolean get(); void toggle(); }
BooleanPreference extends Preference<Boolean> { @Nullable @Override public Boolean get() { if (contains()) { return readSharedPreferences().getBoolean(getKey(), false); } else { return getDefaultValue(); } } BooleanPreference(final String name, final String key,
            @Nullable final Boolean defaultValue); @Override boolean exists(); @Nullable @Override Boolean get(); void toggle();  }