android - RecyclerView parameters stick around after re-drawing the list -


so, i've got recyclerview textviews on cards. 1 of these can turn red&bold, based on parameters, using holder.devicetv.settextcolor(color.red); & holder.devicetv.settypeface(null, typeface.bold); works fine, can see in image below, above black bar.

later, remove cards red&bold textview, , notify adapter. results in see below black bar in image, should not case. i'm guessing because (duh) recyclerview, parameters set on before, have stayed around. don't know why chooses use cards red&bold text, does, every time.

what best way fix issue?

1

you need call holder.devicetv.settextcolor(color.black) , holder.devicetv.settypeface(null); in onbindviewholder method make sure displayed want.

there might small overhead it's faster creating new view scratch.


Comments

Popular posts from this blog

ios - Memory not freeing up after popping viewcontroller using ARC -

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -