I'm having the following error in my app :
java.lang.IllegalStateException: Two different ViewHolders have the same stable ID. Stable IDs in your adapter MUST BE unique and SHOULD NOT change.
ViewHolder 1:ViewHolder{c7b44d1 position=5 id=3, oldPos=-1, pLpos:-1 not recyclable(1)}
View Holder 2:ViewHolder{67232f6 position=3 id=3, oldPos=-1, pLpos:-1}
I'm using MaterialDrawer from Mike @github, this is my viewholder sample :
public class FavoritesViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener{
TextView Title;
ImageView Pic;
public FavoritesViewHolder(View itemView) {
super(itemView);
itemView.setOnClickListener(this);
Title = (TextView) itemView.findViewById(R.id.textViewHighlight);
Pic = (ImageView) itemView.findViewById(R.id.imageViewHighlight);
}
}
Two fragments are switching their layout, when i press the first, it load without any problem, when i press the second fragment, it load a different layout and FC itself.
Both fragmets use the same ViewHolder code but in different classes .