Skip to content

Instantly share code, notes, and snippets.

@khunzohn
Last active June 23, 2017 02:45
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 khunzohn/0a5a2218f0b3379a13fb52984ee32964 to your computer and use it in GitHub Desktop.
Save khunzohn/0a5a2218f0b3379a13fb52984ee32964 to your computer and use it in GitHub Desktop.
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_kotlin_extensions)
welcomeMessage.text = "Hello Kotlin!"
helloButton.setOnClickListener { toast.("Hello Kotlin") }
}
fun setMessaeg(message: String) {
welcomeMessage.text = message // this wont call findViewById again
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment