I have a listview which shows price of items. I need to strike the old price and show the new price based on "offer" value from json. This is how i try to do it inside my getView().
if (dataList.get(position).get("Offer").equals("0")) {
viewHolder.view_price.setVisibility(View.GONE);
} else {
viewHolder.view_subprice.setPaintFlags(viewHolder.view_price.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG)
}
It works perfectly in the beginning. But when I scroll the strikethrough messes up. Textviews that doesn't have a strike appears to be striked.