samedi 18 juillet 2020

Library API with Activity as entery point - how to provide result to main module?

We create a library which entry point is an Activity. There's a lot going on inside, and finally we need to return something to the main module. We want also to enter to this Activity from the notification. This can be done through the Indirect Activity. Now there are 4 options for passing data back to the main module:

  1. startActivtyForResult

  2. Passing the Intent to be called after the end of the process in the module

  3. StateFlow issue that will allow you to observe the process status in the module

  4. Passing callbacks to the library and storing them somewhere in Singleton.

What would you choose?

Aucun commentaire:

Enregistrer un commentaire