Hello! I have an audio recording service in my com...
# compose
k
Hello! I have an audio recording service in my compose app. When the app records audio, I display a custom sticky bottombar. The foreground notification has a stop action intent that the user can trigger. How can I hide the bottombar when the user pressed the "Stop" notification action? The logic works right now, the service stops, saves the audio and the recording ends. But the UI is not updated because I manage the state in my ViewModel. And since the state on the UI side did not change, the UI is the same. I manage state on the UI side too as the bottombar also has a stop button. Using that one works. My view model extends
ViewModel
. I just found out about
AndroidViewModel
. Is this the way to go? Use an IBinder to sync state between both of them. Since I can do that with
AndroidViewModel
but not
ViewModel
.