In Kotlin, What's the best way to iterate through an Android Cursor object and put the results into a list?
我的自动转换Java:
val list = ArrayList<String>()
while (c.moveToNext()) {
list.add(getStringFromCursor(c))
}
Is there a more idiomatic way? In particular, can it be done in a single assignment of a read-only list? E.g....
val list = /*mystery*/.map(getStringFromCursor)
...或某种其他布置,其中列表被分配为完全形成的.