A Pen by suraj kumar on CodePen.
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
<TextView | |
android:id="@+id/resultTv" | |
android:textSize="18sp" | |
android:textStyle="bold" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
/> |
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
//GET DATA FROM INTENT | |
var intent = intent | |
val name = intent.getStringExtra("Name") | |
val phone = intent.getStringExtra("Phone") | |
//TEXTVIEW |
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 |
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
<EditText | |
android:id="@+id/nameEt" | |
android:hint="Enter Name" | |
android:inputType="text" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
/> | |
<EditText | |
android:id="@+id/phoneEt" |