"ghffh"
}]
val arrayList = Arrays.asList<MyModel>(newitem)
I want to replace a value inside it like replace "aaa": "#FF7B5CC1", to "aaa": "#000000"
Dima
let say i have `data class Mymodel(val aaa:String, val bbb:String,val ccc:String)
in my class i have val arrayList = Arrays.asList<MyModel>(newitem) how can i replace the value inside it ?
arrayList.forEach { if (it.aaa == "#...") it.aaa = "#..." }
Look like you have the wrong data structure. List only contains items but doesnt use keys and gives access by index, so you have to iterate through list, find entry and change its property.
Обсуждают сегодня