How can i edit the text of textview from .java? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

How can i edit the text of textview from .java?

25th Mar 2017, 8:41 AM
Prabhakar Dev
Prabhakar Dev - avatar
2 Answers
+ 6
To be more clear, XML <TextView .... android:id="@+id/textView" .... /> JAVA TextView tV = (TextView) findViewById(R.id.textView); tV.setText("YOUR_TEXT_HERE");
25th Mar 2017, 4:41 PM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
0
TextView text1 = (TextView) findViewById(R.id.text1); text1.setText("Hello");
25th Mar 2017, 10:08 AM
LordHill
LordHill - avatar