Last active
February 25, 2020 12:34
-
-
Save surajme/901454fb23a41c84b88e8ee41d47676e 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 nameET = findViewById<EditText>(R.id.nameEt) | |
val phoneEt = findViewById<EditText>(R.id.phoneEt) | |
val saveBtn = findViewById<Button>(R.id.saveBtn) | |
//HANDLE BUTTON CLICK | |
saveBtn.setOnClickListener { | |
//GET TEXT FROM EDITTEXT | |
val name = nameET.text.toString() | |
val phone = phoneEt.text.toString() | |
//INTENT TO START NEW ACTIVITY | |
val intent = Intent (this, Main2Activity:: class.java) | |
intent.putExtra("Name", name) | |
intent.putExtra("Phone", phone) | |
startActivity(intent) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment