I currently use LifecycleObserver
for notifying about events such as onStart
of my view. This is great for components as presenters or handlers, such as FacebookLoginHandler
that needs to register the callback once the view is ready. However, there are some situations, as the one I've mention, that I wanted my handler to handle the returned data of another activity.
Example:
When I choose to login with Facebook, it starts another activity and the return of it goes to view's onActivityResult
method. this makes me inject my FacebookLoginHandler
in the view, only to delegate the handling back to it. I wanted to use LifecycleObserver
to get notified of onActivityResult
and avoid having to couple my handler to the view only for delegating this event. Is there a way to do that?