Created
May 17, 2018 18:57
-
-
Save maskaravivek/4a6bbaea33beb8e21d852aa1790d11f7 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
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