CheckBox RecyclerView auto checked issue. Detailed below


When I check a box and in recycler view auto-checked after 11- 12 item. I didn’t even clicked that checkbox here is the code.
I think this issue is in holder with the position so I’m only providing holder code because it’s confidential.

Adapter holder code:

inner class ProductListViewHolder(val itemBinding: SelectProductLayoutBinding) :
    RecyclerView.ViewHolder(itemBinding.root) {
    fun bindItems(data: ManufacturingProductItem, position: Int) {
        if ( != null)
            itemBinding.userNameTv.text =
            itemBinding.userNameTv.text = ""
        itemBinding.userNameTv.setOnClickListener {

in belove code about pagination of recycler view kindly understand please

binding.productRv.addOnScrollListener(object : RecyclerView.OnScrollListener() {
        override fun onScrollStateChanged(recyclerView: RecyclerView, newState: Int) {
            super.onScrollStateChanged(recyclerView, newState)
            if (newState != RecyclerView.SCROLL_STATE_IDLE) {
            if (!recyclerView.canScrollVertically(1)) {
                if (productAdapter.getProductResponseList.size > 2) {
                    productPresenter.getProducts("", count.toString(), true)


I found the solution of this problem

It simply need these function to implement

override fun getItemId(position: Int): Long {
    return position.toLong()

override fun getItemViewType(position: Int): Int {
    return position

Answered By – mujammil soft

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published