I use kotlin and anko to create a warning / dialog (code below), but when you click outside or push it, it closes.
Here is the code
alert("TITLE") {
title("Text")
positiveButton("Ok") { action() }
}.show()
This is how the solution will be in java (without using anko too)
dialog.setCancelable(false); // for prevent on back pressed
dialog.setCanceledOnTouchOutside(false); // for prevent on touching outside
Any ideas on how to achieve this using kotlin and anko? Thank:)
source
share