Does anyone know why `cancellable` is gone when bu...
# anko
d
Does anyone know why
cancellable
is gone when building alerts?
o
Hi, Damian Could you please try this way:
Copy code
val pwAlert = activity.alert(Appcompat) {
            titleResource = R.string.title
            messageResource = R.string.message
            okButton { okClick() }
            cancelButton { cancelClick() }
        }.build()
        pwAlert.setCancelable(false)
        pwAlert.setCanceledOnTouchOutside(false)
        pwAlert.show()
If this was your question...
d
it does work but only with
alert(Appcompat) {}
but it doesn’t work with
alert {}
which returns
DialogInterface
on
build()
thanks anyway, I am going to migrate to AppCompat dialog so it should work for me but I don’t really see a reason why cancellable was removed from anko’s builder
👍 1
this is really bad that from this
show()
now I have to use this
.build().apply { setCancelable(false) }.show()
found issue no github if that helps to anyone else https://github.com/Kotlin/anko/issues/397
👍 1
there is even a PR that fixes this https://github.com/Kotlin/anko/pull/405 it was added in June