summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanesh M <daneshm90@gmail.com>2012-07-19 21:23:01 -0400
committerDanesh M <daneshm90@gmail.com>2012-07-19 21:23:01 -0400
commit0412f1e010318cd524390db019ad094f91ebd8d5 (patch)
treec77fc69ef3c3d644040af911cf990f25de608832
parent8f00bb4d6a2096cc8d1a901f50fb9e5ef9913b6d (diff)
downloadframeworks_base-0412f1e010318cd524390db019ad094f91ebd8d5.zip
frameworks_base-0412f1e010318cd524390db019ad094f91ebd8d5.tar.gz
frameworks_base-0412f1e010318cd524390db019ad094f91ebd8d5.tar.bz2
ListPreferenceMultiSelect - Override get/set summary
This fixes the % force closes due to format exception Change-Id: If642fb80c579358231c6ef3536865ea8e9ca200b
-rw-r--r--core/java/android/preference/ListPreferenceMultiSelect.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/core/java/android/preference/ListPreferenceMultiSelect.java b/core/java/android/preference/ListPreferenceMultiSelect.java
index a7dc1bd6..a8c711b 100644
--- a/core/java/android/preference/ListPreferenceMultiSelect.java
+++ b/core/java/android/preference/ListPreferenceMultiSelect.java
@@ -31,6 +31,8 @@ public class ListPreferenceMultiSelect extends ListPreference {
private boolean[] mClickedDialogEntryIndices;
+ private String mSummary;
+
public ListPreferenceMultiSelect(Context context) {
super(context);
}
@@ -106,4 +108,24 @@ public class ListPreferenceMultiSelect extends ListPreference {
}
}
}
+
+ @Override
+ public CharSequence getSummary() {
+ final CharSequence entry = getEntry();
+ if (mSummary == null) {
+ return super.getSummary();
+ } else {
+ return mSummary;
+ }
+ }
+
+ @Override
+ public void setSummary(CharSequence summary) {
+ super.setSummary(summary);
+ if (summary == null && mSummary != null) {
+ mSummary = null;
+ } else if (summary != null && !summary.equals(mSummary)) {
+ mSummary = summary.toString();
+ }
+ }
}