我长按了一下任务,然后它消失了,我转到另一个屏幕并返回查看此任务,之后再次长按它,直到任务完成(状态= 1), 调试器说代码已执行
override fun onLongClick(view: View, position: Int) {
val aims = aimsList!![position]
aimsList!!.removeAt(position)
adapter!!.notifyItemRemoved(position)
doAsync {
aims.state = 1 //state "1" is completed task, state"0" is uncompleted
AimsDataBase.getINSTANCE(context!!).daoAccess().updateAim(aims)`
uiThread {
Toast.makeText(context!!, "completed", Toast.LENGTH_SHORT).show()
}
}
}