Hey everyone, normally when we are working on a background thread and want to update UI, we switch to Main thread. Is this still the case in jetpack compose?
b
Bagadeshkumar R
07/11/2024, 3:13 PM
You update state objects which can be done in any thread.
If you use StateFlow or others, which can be updated in a thread safe manner. It would work as expected.
But there is a limitation with updating a state with different threads. It won't work because the composer will be tracking main thread's snapshot.