title: Problems updating recycler views with sqlite database in kotlin
body: <p>I am writing a code that deletes the item from the database when the button of the popup menu is pressed , and deletes it according to the recycler viewer.
  selected item is deleted from the database, but not from the recycler view.</p>
  <p>error code: No error code</p>
  <p><strong>PrintActivity.kt</strong></p>
  <pre><code>class PrintActivity : AppCompatActivity() {
      val helper = SqliteHelper(this, &quot;myDB.sql&quot;, 1)
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          val vBinding = ActivityPrintBinding.inflate(layoutInflater)
          setContentView(vBinding.root)
  
          var recyclerViewAdapter = CustomAdapter()
          recyclerViewAdapter.listData = helper.select()
          vBinding.myRecyclerView.adapter = recyclerViewAdapter
          vBinding.myRecyclerView.layoutManager = LinearLayoutManager(this)
          vBinding.myRecyclerView.addItemDecoration(
              DividerItemDecoration(this, DividerItemDecoration.VERTICAL)
          )
      }
  
      inner class CustomAdapter : RecyclerView.Adapter&lt;CustomAdapter.Holder&gt;(){
          var listData = ArrayList&lt;questionType&gt;()
          inner class Holder(val vBinding: QuestionLayoutRecyclerBinding) :
              RecyclerView.ViewHolder(vBinding.root){
  
                  fun setData(id:Int?, question: String, answer: String, exp: String) {
                      vBinding.printId.text=id.toString()
  
                      vBinding.myLinear.setOnClickListener {
                          var myPopupMenu = PopupMenu(this@PrintActivity, it)
                          menuInflater?.inflate(R.menu.menu, myPopupMenu.menu)
                          var listener = PopupMenuListener()
                          myPopupMenu.setOnMenuItemClickListener(listener)
                          myPopupMenu.show()
                      }
                  }
  
              inner class PopupMenuListener:PopupMenu.OnMenuItemClickListener{
                  override fun onMenuItemClick(p0: MenuItem?): Boolean {
                      listData[adapterPosition].id?.let { helper.delete(it) }
                      //here
                      this@CustomAdapter.notifyDataSetChanged()
                      return false
                  }
              }
           }
  
          override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CustomAdapter.Holder {
              val vBinding = QuestionLayoutRecyclerBinding.inflate(
                  LayoutInflater.from(parent.context),
                  parent,
                  false
              )
              return Holder(vBinding)
          }
  
          override fun onBindViewHolder(holder: Holder, position: Int) {
              val question = listData[position]
              holder.setData(question.id, question.question, question.answer, question.exp)
          }
  
          override fun getItemCount(): Int {
              return listData.size
          }
  
      }
  
  }
  
  
  </code></pre>