在adapter中重写 submitList
override fun submitList(list: MutableList<String>?) {
super.submitList(if (list != null) ArrayList(list) else null)
}
可以查看这个问答https://stackoverflow.com/questions/49726385/listadapter-not-updating-item-in-recyclerview?rq=1