https://kotlinlang.org logo
Title
u

user

07/13/2022, 11:51 PM
What is the simple way to add a left icon to each line, in an alert list dialog using Kotlin? In my Android (write in kotlin) App I have an alert dialog with a similar structure like this. The list of items is injected from a json, but for this question I made the code more simple.
var items = mutableListOf()
items.addAll(listOf("line 1", "line 2", "line 3", "line x"))
val builder = android.app.AlertDialog.Builder(this@aplicacion)
var items2=items.toTypedArray()
with(builder)
{
setItems(items2) { dialog, i ->
var...