Android(安卓)解决Recycler View: Inconsistency detected.
16lz
2022-01-27
Recycler View: Inconsistency detected. Invalid view holder adapter positionViewHolder
这是android的一个已知bug,可以通过try-catch解决,没有副作用
public class WrapContentLinearLayoutManager extends LinearLayoutManager { //... constructor @Override public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state) { try { super.onLayoutChildren(recycler, state); } catch (IndexOutOfBoundsException e) { Log.e("Error", "IndexOutOfBoundsException in RecyclerView happens"); } }}
更多相关文章
- Android(安卓)Base64Encoder解决方案
- Android(安卓)Studio/Gradle/重复依赖
- Android(安卓)studio 常见问题
- android WebView加载URL不显示图片
- 彻底解决Android中文乱码
- android 自定义对话框宽不能占满父layout的解决办法
- Android获取MAC地址
- android 使用动画 Button移动后不响应点击事件的解决办法
- android 模拟器 PANIC: Could not open: AVD 解决方法