开发者

Add line break when reading text from xml

开发者 https://www.devze.com 2023-03-31 12:26 出处:网络
In my application开发者_如何学编程, I\'m parsing a local xml file, store the read texts in an array list and set the texts in text views. the problem is that I can\'t use the \\n sequence to get a lin

In my application开发者_如何学编程, I'm parsing a local xml file, store the read texts in an array list and set the texts in text views. the problem is that I can't use the \n sequence to get a line break in the text view. The text view will display the \n characters as any other text. If I try to use the html tag

, I'm getting a runtime error.

Is there a way to specify the line breaks when reading the text from an xml file?


public static String newline = System.getProperty("line.separator");

instead "\n" now use "newline"

0

精彩评论

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