how to make it update an if : val status by…
- User
how to make it update an if : val status by connectivityObserver.observe().collectAsState( initial = ConnectivityObserver.Status.Unavailable ) if (status != ConnectivityObserver.Status.Available){ NoConnectionScreen() }
- Assistant
To make sure that your
ifstatement updates whenever thestatuschanges, you should use the state management capabilities provided by Jetpack Compose along with the method. The way you've set up your code snippet looks mostly correct; however, if you're running into issues where the UI isn't updating when the changes, you should ensure that your is being correctly used inside a Composable context.