title: How to change the background color of selected item in RecyclerView
body: <p>I created a Kotlin mobile app. In my app i use the <code>RecyclerView</code> with adapter. 
  I want to changing the background color of item clicked  in my <code>RecyclerView</code>, and when i click on another item, the color will be change and the color of the first item clicked return to the default color. </p>
  
  <pre><code>override fun onBindViewHolder(holder: ViewHolder, position: Int) { 
         val itemCategory: ProductCategoryData = categories[position] 
         holder.categoryId.text = itemCategory.id.toString() 
  
         println(holder.categoryId.text) 
         println(itemCategory.name?.get("En").toString()) 
         holder.categoryName.text = itemCategory.name?.get("En").toString() 
        ............ 
         holder.itemView.setOnClickListener { 
             rowindex = position 
             mListener?.onItemClick(holder.itemView, categories[position]) 
         } 
         if (rowindex == position) { 
             holder.itemView.setBackgroundColor(Color.parseColor("#FED07A")) 
         } else { 
             holder.itemView.setBackgroundColor(Color.parseColor("#ffffff")) 
         } 
  
     }
  </code></pre>
  
  <p>What should i change in my code to make it functional </p>