Describe the bug
When extending CropImageActivity, the AlertDialog is cancellable if touched outside. If the user accidentally touches outside the dialog, it is left into a black CropImageActivity and the dialog never comes back. If trying to override the method after my CropImageActivity extension's onCreate:
override fun showImageSourceDialog(openSource: (Source) -> Unit) {
AlertDialog.Builder(this)
.setTitle("sample title")
.setCancellable(false) // Does not work :(
.setItems(
arrayOf(
getString(R.string.pick_image_camera),
getString(R.string.pick_image_gallery),
)
) { _, position -> openSource(if (position == 0) Source.CAMERA else Source.GALLERY) }
.show()
}
...no custom title is assigned, plus the dialog is still cancellable even after told otherwise. The debugger never enters this method.
To Reproduce
Steps to reproduce the behavior:
- Create a new
CropImageActivity just as shown in the documentation.
- Touch outside the dialog once it appears.
Expected behavior
The dialog should not be cancelled on touch outside.
Media
Please add screenshots and/or screen recordings to help explain your problem.
We cannot help without more information
Smartphone (please complete the following information):
- Device: Huawei P40 Pro, Nexus 5 (emulated).
- OS: Android 10, Android 12 respectively.
Describe the bug
When extending
CropImageActivity, theAlertDialogis cancellable if touched outside. If the user accidentally touches outside the dialog, it is left into a blackCropImageActivityand the dialog never comes back. If trying to override the method after myCropImageActivityextension'sonCreate:...no custom title is assigned, plus the dialog is still cancellable even after told otherwise. The debugger never enters this method.
To Reproduce
Steps to reproduce the behavior:
CropImageActivityjust as shown in the documentation.Expected behavior
The dialog should not be cancelled on touch outside.
Media
Please add screenshots and/or screen recordings to help explain your problem.
We cannot help without more information
Smartphone (please complete the following information):