The int position in my onBindViewHolder is in the red line, I don't know how to identify the problem, and to change the code but when I hover int position, it states there that " Do not treat the position as fixed; only use immediately and call holder.getAdapterPosition() to look it up later ". Please help :(
@Override
public void onBindViewHolder(@NonNull ViewHolder holder,int position) {
Glide.with(context).load(categoryList.get(position).getImg_url()).into(holder.catImg);
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(context, ViewAllActivity.class);
intent.putExtra("type",categoryList.get(position).getType());
context.startActivity(intent);
}
});
}