lyft/scoop

Background and foreground behaviour

pakoito opened this issue · 3 comments

Our application has some triggers when it goes background and foreground that need to be reflected on the ViewController. How would you recommend passing that information to it, via an observable/bus that's passed on the component and the VC listens for until detached?

I can't label this as a question, only owners can.

lexer commented

@pakoito You create a special class that can manage callbacks. You instantiate that class in your activity and invoke it's methods inside resume and pause. These method will forward resume/pause to callbacks. This class you register in activity scoop. And then you can inject it to your controller and subscribe on resume and pause.

We are using RxJava behavior subject instead of callbacks.

Let me know if it's clear or not. Guess we will eventually add it to sample.

Yes, similar to RxLifecycle, it's pretty clear.

Hi @lexer I am wondering which part of the sample demonstrate the solution? Thanks!