Created
November 27, 2019 16:24
-
-
Save mantisbayne/a01dd0521f646406b8167d16a6f82e9f 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
@Injectable(ExampleModules::class) | |
class ExampleActivity : FragmentActivity() { | |
// Assuming you have set up your Presenter or another class that uses ViewModel (if using MVVM) | |
// This example uses MVP, but MVVM only requires a few more steps | |
val presenter: ExampleViewModel by viewModel() | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_quotes) | |
presenter.getAll().observe(this, Observer<List<Example>> { examples -> | |
// .. what we want to do when we get everything | |
}) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment