Last active
January 26, 2020 21:39
-
-
Save objcode/45ae7f2e7f0accca271983be50618f67 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Using view binding in an Activity | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
val binding = ActivityAwesomeBinding.inflate(layoutInflater) | |
binding.title.text = "Hello" | |
binding.subtext.text = "Concise, safe code" | |
binding.button.setOnClickListener { /* ... */ } | |
setContentView(binding.root) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment