Skip to content

Instantly share code, notes, and snippets.

@tmaxxdd
Last active July 11, 2019 08:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmaxxdd/c2455bcfe4694ba7fcb575fd2f80b46a to your computer and use it in GitHub Desktop.
Save tmaxxdd/c2455bcfe4694ba7fcb575fd2f80b46a to your computer and use it in GitHub Desktop.
private lateinit var presenter: TopicsPresenter
...
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
presenter = TopicsPresenter(dataRepository)
}
...
override fun onResume() {
super.onResume()
//Notice presenter that view can be accessible
presenter.onViewActive(this)
}
override fun onPause() {
//Notice presenter that view cannot be accessible
presenter.onViewInactive()
super.onPause()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment