How to add a dismiss on a listener argument in a AlertDialog
I'm doing a method to create a custom AlertDialog in which I can call this method passing text, and listener to open a dialog in everywhere.
My problem is that when I'm use it, I need to call a dismiss in every button of the custom view, but when I call this method the system no need to know anything about the dialog.
So, I need to add a "dismiss" on the passed listener or something like that.
private fun showCustomAlertDialog(context: Context, title: String?, message: String?,...