Preserving space at the end of a strings.xml string

Any trailing space in an xml string in Android will be stripped out prior to display. This can lead to bunched up displays like this:
You have scored:40 points.
When what you really wanted was:
You have scored: 40 points.
To get around this you have to use the unicode character for a space \u0020.
The details are here.
This saved me a lot of time, so I decided to repost.

Comments

Popular posts from this blog

AutoCompleteTextView backed with data from SQLite in Android

Building a choropleth map for Irish agricultural data

Using Statistics to Hire Developers