title: How do I remove an item from recyclerView?
body: <p>How can I remove an item from the recycler view?</p>
  
  <p>I have the following code</p>
  
  <p>in    </p>
  
  <pre><code> class LibraryAdapter(val list: ArrayList&lt;Book&gt;): RecyclerView.Adapter&lt;LibraryAdapter.ViewHolder&gt;() {
   override fun onBindViewHolder(holder: ViewHolder, position: Int) {
  
    holder.removeBtn.setOnClickListener {
          this.removeItem(position)
          MUser.removeFromLibrary(list[position].id)
      }
  </code></pre>
  
  <p>Then I have the function </p>
  
  <pre><code>fun removeItem(position: Int) {
      list.removeAt(position)
      notifyItemRemoved(position)
  }
  </code></pre>