문제

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!

도움이 되었습니까?

해결책

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");
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top