Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
When using a SummaryProvider with MultiSelectListPreference to display a summary of the currently selected items, SummaryProvider#provideSummary() is not called so the summary is not updated to represent the newly selected items. This is because notifyChanged() is not called from within setValues().
Comparison of code from ListPreference and MultiSelectListPreference
--- ListPreference ---
public void setValue(String value) {
// Always persist/notify the first time.
final boolean changed = !TextUtils.equals(mValue, value);
if (changed || !mValueSet) {
mValue = value;
mValueSet = true;
persistString(value);
if (changed) {
notifyChanged();
}
}
}
--- --- ---
--- MultiSelectListPreference ---
public void setValues(Set<String> values) {
mValues.clear();
mValues.addAll(values);
persistStringSet(values);
}
--- --- ---
Current workaround: subclass MultiSelectListPreference and override:
@Override
public void setValues(Set<String> values) {
super.setValues(values);
notifyChanged();
}