Chachako
02/24/2021, 7:23 AMremember { mutableStateOf(...) }
will be reorganized immediately after each setValue
, but I just want to update the variable, and then manually reorganize and remember this variable at some point. what should I do?Karthick
02/24/2021, 8:45 AMvar value = remember { value }
without mutableState and another variable var state = remember { stateOf(value) }
for ui. And can change state at some pointChachako
02/24/2021, 8:52 AMvar stateSize by remember { mutableStateOf(0) }
var size = stateSize
try {
xxx.forEach {
size++
}
} finally {
state = size
}
Text(text = "last = $stateSize")
Adam Powell
02/24/2021, 2:47 PM