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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM