<string
This is a test\n
This is another line.
/>
I try to show this in a textview when the newline (or the white space before the start of the next line) causes the new line to be indented by 1 blank space. Show basically th开发者_运维技巧is looks like -
This is a test
This is another line
Why is this happening and how do I fix this? Any clues?
I think it has to do with the extra whitespace you are adding yourself in the characters. I would guess that Android is treating all of your extra whitespace as a single space (it may also be a function of the parser, I am not sure).
I think you would rather do something like this to get what you are expecting.
<resources>
<string name="test_str">This is a test\nThis is another line.</string>
</resources>
精彩评论