How can I save list in compose? For example, ```va...
# compose
c
How can I save list in compose? For example,
Copy code
var selectedItems by rememberSaveable { mutableStateListOf<Int>(listOf<Int>()) }
e
Copy code
rememberSaveable(
    saver = listSaver(
        save = { it.toList() },
        restore = { mutableStateListOf<Int>().apply { addAll(it) } }
    )
) { mutableStateListOf<Int>(...) }
c
What should I add in '...' ? both didn't work.
e
that's unrelated, you'd have that issue even with
remember()
c
I just want to know how to use it.
168 Views