Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b187a847 authored by Romain Guy's avatar Romain Guy
Browse files

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
parent 7f3e62cd
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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 " +