问题:basequickadapter中setEmptyView设置了之后第一次加载没问题,第二次加载就报错:java.lang.IllegalStateException: ViewHolder views must not be attached when created. Ensure that you are not passing 'true' to the attachToRoot parameter of LayoutInflater.inflate(..., boolean attachToRoot)
解决办法,在ondestroy的方法里面添加对adapter资源的释放即可
代码:
override fun onDestroy() {
super.onDestroy()
mBinding.rvBaseConsumeDetail.adapter = null
}