I keep getting java.lang.IllegalArgumentException: Scrapped or attached views may not be recycled. isScrap:false isAttached:true when using Fragment with Re
Ok so I've found were the problem was. In my ViewHolder I had in addition to the layout Views, an ORMlite entity (could've been any object that was not part of the layout). The problem was that the ViewHolder's equals() and hashcode() methods were based on the entity which was null. The reason it was null was because with RecyclerView you don't have access to the data position in onCreateViewHolder(), but only in onBindViewHolder(). The adapter data is a list of ORMlite entities in my case, and I want to bundle the entity inside the holder. (Still have to find a way to do this...)
I was expecting a NullPointerException in this case. I've manage to get a NullPointerException by calling holder.setIsRecyclable(true).
Hope this helps others in need..
Thanks