summaryrefslogtreecommitdiff
path: root/core/java/android/widget/SimpleAdapter.java
diff options
context:
space:
mode:
authorRomain Guy <romainguy@android.com>2010-03-23 12:42:51 -0700
committerRomain Guy <romainguy@android.com>2010-03-23 12:42:51 -0700
commitb187a847a5b1ad7b03c1fff95366e8cf6bc96be2 (patch)
tree5f791eac53764c1fca93d96fd834de6e3a911fe0 /core/java/android/widget/SimpleAdapter.java
parent7f3e62cd921e7dfcdec1ed78ba2ef072beeecdd3 (diff)
Correctly bind spinner data to TextView.
Bug http://code.google.com/p/android/issues/detail?id=7251 Previously, a spinner using checkable list items would try to bind data as booleans instead of text. This change takes this use case into account. Change-Id: Ie4ced01e3c0235138e1dd68426d6a748c2843a9c
Diffstat (limited to 'core/java/android/widget/SimpleAdapter.java')
-rw-r--r--core/java/android/widget/SimpleAdapter.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/java/android/widget/SimpleAdapter.java b/core/java/android/widget/SimpleAdapter.java
index 479965add4c4..4b17a9205eeb 100644
--- a/core/java/android/widget/SimpleAdapter.java
+++ b/core/java/android/widget/SimpleAdapter.java
@@ -172,6 +172,10 @@ public class SimpleAdapter extends BaseAdapter implements Filterable {
if (v instanceof Checkable) {
if (data instanceof Boolean) {
((Checkable) v).setChecked((Boolean) data);
+ } else if (v instanceof TextView) {
+ // Note: keep the instanceof TextView check at the bottom of these
+ // ifs since a lot of views are TextViews (e.g. CheckBoxes).
+ setViewText((TextView) v, text);
} else {
throw new IllegalStateException(v.getClass().getName() +
" should be bound to a Boolean, not a " +