Spannable String only working for last Item in ListView

后端 未结 2 1878
情歌与酒
情歌与酒 2020-12-04 03:34

Edit:

I\'m now able to strike words in the listview but only able to do it from the bottom up and can only unstrike the bottom item afterwards. The code is below.

2条回答
  •  南方客
    南方客 (楼主)
    2020-12-04 04:09

    You should pass checked state and tasksTitle to toggleLineThrough() too. Variables completed and tasksTitle contain wrong values because onClickListener is called later than getView(). They were overwritten several times by consecutive calls of getView().

提交回复
热议问题