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
  • 2,723
  • 3
  • 23
  • 36
dcanh121
  • 4,509
  • 10
  • 34
  • 80
  • 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