title: How to Set confirm delete AlertDialogue box in kotlin
body: <p>I have finished building a note app following an old tutorial.
  I want to set AlertDialogue box to confirm from the user if he really wish to delete a note.</p>
  
  <p>This is what i did that closes the App</p>
  
  <pre><code> override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View {
              //inflate layout row.xml
              var myView = layoutInflater.inflate(R.layout.row, null)
              val myNote = listNotesAdapter[position]
              myView.titleTv.text = myNote.nodeName
              myView.descTv.text = myNote.nodeDes
              //delete button click
              myView.deleteBtn.setOnClickListener {
                  var dbManager = DbManager(this.context!!)
                  val selectionArgs = arrayOf(myNote.nodeID.toString())
                  dbManager.delete("ID=?", selectionArgs)
                  LoadQuery("%")
  
                  val builder = AlertDialog.Builder(this@MainActivity)
                  builder.setMessage("Are you sure you want to Delete?")
                      .setCancelable(false)
                      .setPositiveButton(
                          "Yes",
                          DialogInterface.OnClickListener { dialog, id -&gt; this@MainActivity.finish() })
                      .setNegativeButton("No", DialogInterface.OnClickListener { dialog, id -&gt; dialog.cancel() })
                  val alert = builder.create()
                  alert.show()
              }
  </code></pre>
  
  <p>Please tell me what to do. thank you!</p>