Created
September 21, 2019 03:56
-
-
Save carlosgub/23589834bd8dc68756af62d4eb83e6e0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| val act = this | |
| val layout = LinearLayout(act) | |
| layout.orientation = LinearLayout.VERTICAL | |
| val name = EditText(act) | |
| val button = Button(act) | |
| button.text = "Say Hello" | |
| button.setOnClickListener { | |
| Toast.makeText(act, "Hello, ${name.text}!", Toast.LENGTH_SHORT).show() | |
| } | |
| layout.addView(name) | |
| layout.addView(button) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment