I tried recyclerview.post{} and if(recyclerView.isComputingLayout)。but useless。
the bug repear when I add catch in my RecyclerView like this:
<code>override fun onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int) {
try {
super.onLayout(changed, l, t, r, b)
} catch (e: IllegalArgumentException) {
Ln.e(e)
}
}
</code>
<code>override fun onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int) {
try {
super.onLayout(changed, l, t, r, b)
} catch (e: IllegalArgumentException) {
Ln.e(e)
}
}
</code>
override fun onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int) {
try {
super.onLayout(changed, l, t, r, b)
} catch (e: IllegalArgumentException) {
Ln.e(e)
}
}
if I remove the catch block,it will report an other bug: Scrapped or attached views may not be recycled. isScrap:false isAttached:true。
who can help me