Recyclerview 出现 java.lang.IndexOutOfBoundsException: Inconsistency detected 异常

使用 RecyclerView 的时候报错

java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid view holder adapter positionViewHolder{2a7919e position=6 id=-1, oldPos=5, pLpos:5 scrap [attachedScrap] tmpDetached no parent}

找到了一些解决方案:

  1. 捕获该异常:https://stackoverflow.com/questions/31759171/recyclerview-and-java-lang-indexoutofboundsexception-inconsistency-detected-in

  2. 建议:http://blog.csdn.net/zrbcsdn/article/details/50111869

原文地址:https://www.cnblogs.com/liyiran/p/7419967.html