0

I have an activity bound to an aidl service. Activity passes data to the aidl remote service. Remote service passes data back to activity using callbacks.

I want to preserve data that is passed from service to activity using LiveData and ViewModel.

enter image description here

Is there a good design for this problem?

Adib Faramarzi
  • 3,798
  • 3
  • 29
  • 44
dcanh121
  • 4,665
  • 11
  • 37
  • 84
  • see `AndroidViewModel` - it has a `Context` you can use for service binding – pskink Mar 22 '19 at 15:22
  • 1
    And see [this project](https://github.com/commonsguy/cw-androidarch/tree/FINAL/Sensor/LiveService) for an example of how to do it. – CommonsWare Mar 25 '19 at 13:42
  • Can you check this link : https://stackoverflow.com/a/53552240/10271334, I can provide some guideline about how you can achieve such thing. – Jeel Vankhede Mar 29 '19 at 07:04

0 Answers0