public void flush() { for (int i = 0, n = linearLayout.getChildCount(); i < n; i++) { View view = linearLayout.getChildAt(i); if (view instanceof DropdownListItemView) { DropdownListItemView itemView = (DropdownListItemView) view; DropdownItemObject data = (DropdownItemObject) itemView.getTag(); if (data == null) return; boolean checked = data == current; String suffix = data.getSuffix(); itemView.bind(TextUtils.isEmpty(suffix) ? data.text : data.text + suffix, checked); if (checked) button.setText(data.text); } } }