Skip to content

Instantly share code, notes, and snippets.

@marcinOz
Created January 25, 2019 11:01
Show Gist options
  • Save marcinOz/4c6b8ac0e55f9f87525b318cd593fafc to your computer and use it in GitHub Desktop.
Save marcinOz/4c6b8ac0e55f9f87525b318cd593fafc to your computer and use it in GitHub Desktop.
class MyActivity : AppCompatActivity() {
// inject Presenter instance, tied to current MyActivity's scope
val presenter : Presenter by inject()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// bind current lifecycle to Activity's scope
bindScope(createScope("activity"))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment