Skip to content

Instantly share code, notes, and snippets.

@maskaravivek
Created May 17, 2018 18:57
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 maskaravivek/4a6bbaea33beb8e21d852aa1790d11f7 to your computer and use it in GitHub Desktop.
Save maskaravivek/4a6bbaea33beb8e21d852aa1790d11f7 to your computer and use it in GitHub Desktop.
class MainActivity : AppCompatActivity() {
var button: Button? = null
var userNameField: EditText? = null
var displayUserName: TextView? = null
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 = "Hello ${userNameField!!.text}!"
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment