Answer the question
In order to leave comments, you need to log in
Prevent AlertDialog from closing when adapter element is clicked?
There is AletDialog with ArrayAdapter. Clicking on a list item closes the AlertDialog. How can I make the dialog not close? Kotlin snippet:
setAdapter(adapter, DialogInterface.OnClickListener { dialog, which ->
Log.d(TAG, "onClickItem")
val selectedFileItem = adapter.getItem(which)
Toast.makeText(context, "click", Toast.LENGTH_LONG).show()
if (selectedFileItem != null) {
if (selectedFileItem.isDirectory) {
// todo: обновление списка файлов
}
} else {
Log.d(TAG, "DialogInterface.OnClickListener : item ${selectedFileItem?.name} added to selected items")
}
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question