i have an Activity and a Sticky Service. The Activity needs to show some values in it´s UserInterface depending on the values of the Sticky Service. So whenever the Service changes his data, the Activity needs to update it´s UserInterface. But how should the Service notify the Activity to change it´s values??
Please remind that the Activity sometimes isn´t alive, only the Service is Sticky.
Use LocalBroadcasts
in your service class:
and here is method inside service to broadcast
In your activity:
in your activity onDestroy() method unregister receiver;