[Solved] how to show and hide imageview inside recyclerView
You need just add field in your adapter where you will save currently active item. Then call notifyDataSetChanged. Also you should update your onBindViewHolder like this: private int currentPosition = -1; @Override public void onBindViewHolder(@NonNull MyViewHolder holder, int position) { holder.textView.setText(items.get(position)); if (currentPosition == position) { holder.img1.setVisibility(View.INVISIBLE); holder.img2.setVisibility(View.VISIBLE); } else { holder.img1.setVisibility(View.VISIBLE); holder.img2.setVisibility(View.INVISIBLE); } } … Read more