SeekBarPreference: only commit the preference if requested to.

This commit is contained in:
Reece H. Dunn
2013-05-03 11:24:59 +01:00
parent ac6099ebf1
commit 5370341abf
@@ -100,9 +100,11 @@ public class SeekBarPreference extends DialogPreference
mProgress = mSeekBar.getProgress() + mMin;
String text = Integer.toString(mProgress);
callChangeListener(text);
SharedPreferences.Editor editor = getSharedPreferences().edit();
editor.putString(getKey(), text);
editor.commit();
if (shouldCommit()) {
SharedPreferences.Editor editor = getEditor();
editor.putString(getKey(), text);
editor.commit();
}
break;
}
super.onClick(dialog, which);