Basically I'm trying to get my EditText
with a button
"Ok" to display what was written to show up in a TextView
output.
Once the "Ok" button
is pressed it get the text what was entered in the EditText
and display in the TextView
.
Been searching around and can't find anything that works. Can anyone help?
Edit: 1) really appreciate the responds and help guys. 2) I think I"m asking this wrong. What I'm trying to do is creating an option where the user can add their own Text into an activity.
Edit: THANK YOU FOR THE HELP!!!!!!!!!!!!
Let's suppose the EditText is named as
et
, TextView is named astv
and your Button is named a asbt
.. Now declare your EditText, TextView and Button, below your class name like this:Now in your
onCreate
method and aftersetContentView
do as mentioned below :Hope this Helps!
Get Value from
EditText
Set value to
TextView
inButton Click
Update:
implement
Button Onclick(...)
likeUse in your
Activity
inOnCreate()
activity_mail.xml
MainActivity.java