Closed ElianFabian closed 6 months ago
Good idea. It could be similar to findScopesForKey()
However, it needs to consider that setParentServices()
was added, allowing chaining Backstack
instances hierarchically, in which case the lookup should be either scoped to be local
(only include results from this backstack) or global
(also include results of the parents).
Haven't really had time to work on this but I hope to get it done by the end of this week at the latest.
Released in 2.9.0 (it's called findServices()
).
https://github.com/Zhuinden/simple-stack/issues/277 vaguely also applies.
I think it would be helpful to have a way of getting a list of all the currently available services with the Backstack, similar to GlobalServices.services().
A use case for this could be implementing custom callbacks for services, similar to ScopedServices.Registered.
For example, let's say I want a service to be notified when Activity.onNewIntent() is called, It would look like this:
I'm not sure if there would be a better way to achieve a similar result with ease.