I wanna alert dialog when click backpress button once, but the error occured. searching for the error, I found I have to use dismiss(). so I did but not working. could u let me know the problem?
here is error log. 

```
E/WindowManager: android.view.WindowLeaked: Activity com.jakchang.hwahae.Activity.MainActivity has leaked window DecorView@85feca8[MainActivity] that was originally added here
        at android.view.ViewRootImpl.<init>(ViewRootImpl.java:701)
        at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:365)
        at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:93)
        at android.app.Dialog.show(Dialog.java:470)
        at com.jakchang.hwahae.Activity.MainActivity.exitDialog(MainActivity.kt:183)
        at com.jakchang.hwahae.Activity.MainActivity.onBackPressed(MainActivity.kt:167)
        at android.app.Activity.onKeyUp(Activity.java:3168)
        at android.view.KeyEvent.dispatch(KeyEvent.java:3374)
        at android.app.Activity.dispatchKeyEvent(Activity.java:3451)
        at androidx.core.app.ComponentActivity.superDispatchKeyEvent(ComponentActivity.java:115)
        at androidx.core.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:84)
        at androidx.core.app.ComponentActivity.dispatchKeyEvent(ComponentActivity.java:133)
        at androidx.appcompat.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:535)
        at androidx.appcompat.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:59)
        blabla~

```

```
    override fun onBackPressed() {
        super.onBackPressed()
        exitDialog()
    }

    private fun exitDialog() {  
        val builder = AlertDialog.Builder(this)

        builder.setMessage("Close?")

        builder.setPositiveButton("YES") {dialog, id ->
            finish()
        }
        builder.setNegativeButton("NO") {dialog, id ->
            dialog.dismiss()
        }
        builder.create().show()
        //builder.show()

    }

```