Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class MainActivity : AppCompatActivity() {
var button: Button? = null
var userNameField: EditText? = null
var displayUserName: TextView? = null
@Inject lateinit var userService: UserService
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
AndroidInjection.inject(this)
setContentView(R.layout.activity_main)
initViews()
}
private fun initViews() {
button = this.findViewById(R.id.set_user_name)
userNameField = this.findViewById(R.id.name_field)
displayUserName = this.findViewById(R.id.display_user_name)
this.button!!.setOnClickListener({
displayUserName!!.text = userService.displayUserName(userNameField!!.text.toString())
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.