Skip to content

Instantly share code, notes, and snippets.

@markchristopherng
Created February 19, 2020 02:36
Show Gist options
  • Save markchristopherng/34219c3f475be290ee0df71afc8a82e9 to your computer and use it in GitHub Desktop.
Save markchristopherng/34219c3f475be290ee0df71afc8a82e9 to your computer and use it in GitHub Desktop.
class MainActivity : AppCompatActivity() {
@Inject
lateinit var greetingService: GreetingService
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
(application as DaggerApplication).appComponent.inject(this)
val greetings = findViewById<TextView>(R.id.greetingsTextView)
greetings.text = "${greetingService.greetings()}"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment