Question

I am trying to store two carriage returns in in strings.xml but can't figure out why they are ignored. However, if I put them directly into the layout, the carriage returns work fine.

Outputs carriage returns
android:text="

Sent from my wonderful Android device"

Does not output carriage returns
<string name="sent_from">&#xA;&#xA;Sent from my wonderful Android device</string>

Was it helpful?

Solution

Try the following:

<string name="sent_from">\n\nSent from my wonderful Android device</string>

I think that is what you are looking for.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top