Skip to content Skip to sidebar Skip to footer

Using Switch In Recyclerview Srcoll

I have use the Switch in the RecyclerView. It have facing the issue of recycling behaviour. When I switch on the 1st position ,it automatically on the switch at 10 postion ... I th

Solution 1:

You need to use this in the adapter:

@OverridepublicintgetItemViewType(int position) {
        return position;
    }

Solution 2:

This is a very common problem with RecyclerView and there are lots of answers there in Stackoverflow.

You already have understood your problem i.e. reusing the views. So you might take a look at these answers to get a better idea about how you can overcome it.

These will do the trick for you I hope.

Post a Comment for "Using Switch In Recyclerview Srcoll"