У меня есть услуга переднего плана, которая используется для запуска таймера для данного объекта. I would like to:
[*]Pass the object's id to the foreground service when the service is started and store it in the service until it is stopped
[*]Read the object's id from the service and use it to load object-related data from a database into a view model when the MainActivity binds to the service
Update the database (using the object id Хранится в службе) Когда таймер службы остановлен с уровня уведомления.
Подробнее здесь: https://stackoverflow.com/questions/797 ... view-model