Methods Summary |
---|
public boolean | getValue()Gets the value of this preference.
return mWasPositiveResult;
|
protected void | onDialogClosed(boolean positiveResult)
super.onDialogClosed(positiveResult);
if (callChangeListener(positiveResult)) {
setValue(positiveResult);
}
|
protected java.lang.Object | onGetDefaultValue(android.content.res.TypedArray a, int index)
return a.getBoolean(index, false);
|
protected void | onRestoreInstanceState(android.os.Parcelable state)
if (!state.getClass().equals(SavedState.class)) {
// Didn't save state for us in onSaveInstanceState
super.onRestoreInstanceState(state);
return;
}
SavedState myState = (SavedState) state;
super.onRestoreInstanceState(myState.getSuperState());
setValue(myState.wasPositiveResult);
|
protected android.os.Parcelable | onSaveInstanceState()
final Parcelable superState = super.onSaveInstanceState();
if (isPersistent()) {
// No need to save instance state since it's persistent
return superState;
}
final SavedState myState = new SavedState(superState);
myState.wasPositiveResult = getValue();
return myState;
|
protected void | onSetInitialValue(boolean restorePersistedValue, java.lang.Object defaultValue)
setValue(restorePersistedValue ? getPersistedBoolean(mWasPositiveResult) :
(Boolean) defaultValue);
|
public void | setValue(boolean value)Sets the value of this preference, and saves it to the persistent store
if required.
mWasPositiveResult = value;
persistBoolean(value);
notifyDependencyChange(!value);
|
public boolean | shouldDisableDependents()
return !mWasPositiveResult || super.shouldDisableDependents();
|