Created
February 5, 2020 17:43
-
-
Save hadilq/1159f45f44f00f9b6439c92ca1587a4b to your computer and use it in GitHub Desktop.
RxViewModelActivitySample
This file contains 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 RxViewModelActivitySample : ComponentActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.main_activity) | |
val viewModel = ViewModelProvider(this).get(RxViewModelSample::class.java) | |
(viewModel.stringEmitter.observe()) { testString -> | |
/* use it here */ | |
} | |
(viewModel.extendedStringEmitter.observe()) { testString -> | |
/* use it here */ | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment