开发者

Android No Break Space - how to?

I have 开发者_如何学编程a bug, where only on HTC Evo 4g text in EditText shows up with underscores instead of spaces Jack_Johnson, instead of Jack Johnson. The data comes from a server.

How do I incorporate \u00A0 or &nbsp into the code below? Will that even fix my problem?

editName.setText(recipient.name);


Try this:

editName.setText(Html.fromHtml(recipient.name));


So you actually want to unescape the exported from the server escaped special characters? If so, Html.fromHtml won't work, but you can use StringEscapeUtils from the apache commons lang library - http://commons.apache.org/lang/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜