Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get EditText value and display it on screen through TextView?

I want to get the user input for the EditText view and display it on the screen through TextView when the Button is clicked. I also, want to know what modifications can be done on the string.xml file to do this.

like image 810
ragu Avatar asked Dec 09 '10 08:12

ragu


People also ask

How do I get text from EditText?

Now, before we start we need to know some method of EditText which we use to get or fetch the text written in an EditText that is . getText() method and the other one is . setText() method that we use to set some pre-written text or string. EditText demo; demo=(EditText)findViewById(R.

How can I get my EditText number?

Use android:inputType="number" to force it to be numeric. Convert the resulting string into an integer (e.g., Integer. parseInt(myEditText. getText().

Which method is used to get the string value from an EditText?

The method used to get the data from an EditText is getText().


1 Answers

I didn't get the second question, maybe you can elaborate...but for your first query.

String content = edtEditText.getText().toString(); //gets you the contents of edit text tvTextView.setText(content); //displays it in a textview.. 
like image 148
st0le Avatar answered Sep 21 '22 06:09

st0le