android - Adapter not working properly until scrolled -
in listview want have textviews image drawables colored accordingly text. tried using code below while text showing expected, drawable shows last color in list of textviews - until list scrolled, shows right color. @override public view getview(final int position, view convertview, viewgroup parent) { viewholder holder; layoutinflater inflater = (layoutinflater) context.getsystemservice(context.layout_inflater_service); view row = convertview; if (row == null) { row = inflater.inflate(r.layout.mylayout, parent, false); holder = new viewholder(); holder.textview = (textview) row.findviewbyid(r.id.mytextview); holder.img = getresources().getdrawable(r.drawable.my_icon); row.settag(holder); } else { holder = (viewholder) row.gettag(); } holder.textview.settext(colors[position]); int color = 0; switch (colors[position]) { case "blue": color = getresources().getcolo