Created
October 9, 2019 08:10
-
-
Save muhamistau/d52a5a61198a9b7b5a9238c77483ad51 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
| import androidx.appcompat.app.AppCompatActivity | |
| import android.os.Bundle | |
| import android.widget.Button | |
| import android.widget.EditText | |
| import android.widget.TextView | |
| import kotlinx.android.synthetic.main.activity_main.* | |
| class MainActivity : AppCompatActivity() { | |
| lateinit var textView: TextView | |
| lateinit var editText: EditText | |
| lateinit var button: Button | |
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) | |
| setContentView(R.layout.activity_main) | |
| // Old School | |
| textView = findViewById(R.id.hello_world) | |
| editText = findViewById(R.id.editText) | |
| button = findViewById(R.id.button) | |
| button.setOnClickListener { | |
| textView.text = editText.text | |
| } | |
| // New Ways | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment