Skip to content

Instantly share code, notes, and snippets.

@gilgoldzweig
Last active February 2, 2019 20:04
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 gilgoldzweig/c48a1dc1c8b6016e3e859f8d47eb675d to your computer and use it in GitHub Desktop.
Save gilgoldzweig/c48a1dc1c8b6016e3e859f8d47eb675d to your computer and use it in GitHub Desktop.
class ExampleActivity : AppCompatActivity(), ExampleContract.View {
lateinit var presenter: ExampleContract.Presenter
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
//Inject the presenter using Dependecy injection
presenter.fetchProfileName()
}
override fun onProfileNameReceived(name: String) {
//We recived the profile's name. Update ui
}
override fun onProfileNameRequestFailed(exception: Exception) {
//We did not recived the profile's name. Update ui
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment