I have a situation that everytime I scroll the listview the color of a certain row goes to the another row.
Here's my code.
@Override
public View getView(int position, View view, ViewGroup viewGroup) {
final int pos = position;
final ViewHolder holder;
if (view == null) {
inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = inflater.inflate(R.layout.list_admin, viewGroup, false);
holder = new ViewHolder(view);
view.setTag(holder);
} else {
holder = (ViewHolder) view.getTag();
}
if (data.get(pos).getDateEntry().length() > 0) {
view.setBackgroundResource(R.color.SeaGreen);
}
return view;
}