开发者

Setting text to a layout

In a cla开发者_StackOverflow社区ss, 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");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜