Last active
August 6, 2019 16:10
-
-
Save SeongUgJung/1489fe1d43c819ad348adadc4bb8375f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainActivity : Activity() { | |
private val lifecycleController = LifecycleController() | |
fun onCreated() { | |
MainViewModel(controller) | |
} | |
} | |
// Controller 는 Activity 에서 주입됩니다. | |
class MainViewModel(private val controller : LifecycleController) { | |
init { | |
controller.addObserver(RxLifecycle().apply { onInit = /* () -> disposable */ }) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment