-1

In a class, if I want to set the text to the text value of a string I have, what is the code for that?

I have:

TextView textView = (TextView) findViewById(R.string.noFaceFive);
textView.setText(textView);

but setText says :

The method setText(CharSequence) in the type TextView is not applicable for the arguments (TextView).

Is there a set Text to display the text of a string? Serious mind fart on my part...Thanks!

Toto
  • 89,455
  • 62
  • 89
  • 125
Sapp
  • 1,793
  • 7
  • 29
  • 51
  • TextView is a TextView and not a string... you can use the getText() method to get the text within a text view as a string. Please review the Android SDK TextView reference: http://developer.android.com/reference/android/widget/TextView.html – Brian Nov 18 '10 at 21:51
  • ahhhhh...then how do I pass a string to display on an xml page? – Sapp Nov 18 '10 at 21:52
  • textView.setText("This is a string"); – Brian Nov 18 '10 at 21:52

1 Answers1

3

You seem to be trying to set the text property of textView to textView itself. setText() takes a string, so try ...

textView.setText("The text you want to appear");
Blumer
  • 5,005
  • 2
  • 33
  • 47