0

I got a string message taken from a php file. And in Android I've specified a generic string value shown below.

 private static final String message = " ";

How do i get this string value to be shown in the textview in my Android app?

ActiveUser
  • 39
  • 2
  • 5

5 Answers5

2

you can try this:

Textview mytxt=(Textview ) findViewById(R.id.textview1);
mytxt.settext(message );
CompEng
  • 7,161
  • 16
  • 68
  • 122
1

Putting text to textView (you need to get a hold of reference to TextView):

textView.setText(message);

More references: Android - Set text to TextView

Community
  • 1
  • 1
Unii
  • 1,587
  • 15
  • 33
0

take text view reference from findviewbyid

textView.setText(message.trim());
Bhanu Sharma
  • 5,135
  • 2
  • 24
  • 49
0

Use

 textViewName.setText(message);
jyomin
  • 1,957
  • 2
  • 11
  • 27
0

it is very simple try the following code:

TextView yourtextview = (TextView) findViewById(R.id.yourtextview);
yourtextview.setText(message );
Farhan Shah
  • 2,344
  • 7
  • 28
  • 54