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)
解决:
MyBillListDetailsHolder(mLayoutInflater.inflate(R.layout.item_bill_list_details, parent, false))
最后一个参数传false
当创建ViewHoler时,不应将其附加到根布局。文章指出在使用LayoutInflater.inflate方法时,最后一个参数应传入false,以避免非法状态异常。这个问题涉及到Android开发中的视图复用和布局inflate过程。
1455

被折叠的 条评论
为什么被折叠?



