[Solved] how to show and hide imageview inside recyclerView

[ad_1] 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

[Solved] why “abstract method ‘onCreateViewHolder(ViewGroup, int)’ cannot be accessed directly on handling item click recyclerview

[ad_1] why “abstract method ‘onCreateViewHolder(ViewGroup, int)’ cannot be accessed directly on handling item click recyclerview [ad_2] solved why “abstract method ‘onCreateViewHolder(ViewGroup, int)’ cannot be accessed directly on handling item click recyclerview