android - Kotlin / Anko prevent button from closing Alert Dialog -
when using positivebutton , negativebutton in anko's alert builder, seems both of them result in closing dialog, if dismiss() not called. there way keep dialog open after clicking button (if there types other positivebutton/negativebutton, that's fine too)?
alert { title = "add board" customview { .... } positivebutton("ok") { dosomefunction() } negativebutton("close"){} }.show()
for may have issue in future, how can accomplish in kotlin
val myalert = alert { title = "add board" customview { .... } positivebutton("ok") { /*keep blank, we'll override later*/} negativebutton("close"){} }.show() //you can use button_negative , button_neutral other buttons (myalert alertdialog).getbutton(alertdialog.button_positive) .setonclicklistener{ dosomefunction() }
Comments
Post a Comment