Open Rahulkr2 opened 7 years ago
val dd: AlertDialog = alert { }
Above code giving below error.
Error:(621, 35) Type mismatch: inferred type is AlertBuilder
How to do it correctly.
What about
val dialog: DialogInterface = alert { }.show()
if (dialog is AlertDialog) {
// dialog is now smart-casted to AlertDialog
dialog.dismiss()
}
How to get instance of AlertDialog from anko alert() Like `val builder = AlertDialog.Builder(context) .setTitle("Enter Consis") .setView(view) .setNegativeButton("Cancel") { dialog: DialogInterface, which: Int ->
dialog.dismiss() } .setPositiveButton("Search") { dialog: DialogInterface, which: Int -> {} }
How can i achieve above using anko alert() function