Does anyone know how i can get a piece of code to ...
# compose
m
Does anyone know how i can get a piece of code to trigger if the user goes to the notification shade, and then comes back to the application? It doesn’t look like the composable on screen goes through any sort of recomposition, so I can’t necessarily figure out when to trigger the code. My screen is a roadblock to have the user turn on the bluetooth service when it’s off. I want to check when they come back to the shade whether it’s been turned on or not.
c
You might have to do this in Activity/Fragment level. They should be `onPause`ed and `onResume`ed
z
You don’t get pause/resumed when the notification shade is pulled down, at least not on API 30. What will happen is your window will lose then re-gain focus. You can observe
WindowInfo.isWindowFocused
from
LocalWindowInfo
to get this information from Compose.