开发者

Preserve line breaks in strings parsed from XML

I have alert dialog that s开发者_开发知识库hows.. alerts. Alerts are parsed from some xml file (using XmlPullParser), and sometimes they have line breaks like "Foo \nbreak". The problem is that alert is being displayed as "Foo \nbreak", not like

"Foo
break"

(Needles to say, that if I just put "Foo \nbreak" directly in dialog - line breaks are displayed properly.)

And I cant even replace that \n with something useful.. So sad. I suppose, xml "normalizes" all text, or something like this. But what should I do to preserve line breaks?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜