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

Commit ccc1005b authored by David Liu's avatar David Liu Committed by Android Build Coastguard Worker
Browse files

Fix crash in SettingsSpinnerAdapter

getItem(position) will return T but not String. It'll always crash if T is not String.

Bug: 406736217
Test: manual
Flag: EXEMPT bugfix
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:075cf4e48461614bb97c10edab3c7fd1a397000d)
Merged-In: Ic85341cd66770792ad986fa34a461d9eed95dc18
Change-Id: Ic85341cd66770792ad986fa34a461d9eed95dc18
parent f0583086
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -76,8 +76,8 @@ public class SettingsSpinnerAdapter<T> extends ArrayAdapter<T> {
        if (iconView != null) {
            iconView.setVisibility((position == mSelectedPosition) ? View.VISIBLE : View.GONE);
        }
        String item = (String) getItem(position);
        textView.setText(item);
        T item = getItem(position);
        textView.setText(item == null ? "" : item.toString());
        return view;
    }