Open qbait opened 5 years ago
You would get the reference of dialog in it
it is impossible since the type of dialog is AlertBuilder<DialogInterface>
which does not have a dismiss
method.
I have an ulgry solution like this:
var dialog: DialogInterface? = null
dialog = alert {
val view = layoutInflater.inflate(R.layout.match_stats, null)
val closeButton = view.findViewById<ImageButton>(R.id.closeButton)
closeButton.setOnClickListener { _ -> dialog?.dismiss() }
customView = view
}.show()
I would like to dismiss Anko Dialog when pressing the button defined in my
customView
I tried above code, unfortunately, I can’t get a reference to dialog in my onClickListener. Do you have any idea how to solve it?