An AlertDialog is not showing up!

Report a typo

Jasmin is trying to show an AlertDialog whenever the user clicks on the alertDialogButton but it is not showing up. She checked her code and there are no compilation or runtime errors. Help her identify the problem.

alertDialogButton.setOnClickListener {
    AlertDialog.Builder(this)
        .setTitle("Alert Dialog!")
        .setMessage("")
        .setPositiveButton(android.R.string.ok) { _, _ ->
        }
        .setNegativeButton(android.R.string.cancel, null)
}
Select one or more options from the list
___

Create a free account to access the full topic