membersound membersound - 3 years ago 138
Android Question

How to load locale dependent strings in android programmatically?

In Android it's possible to define i18n strings with:


And use them in xml like:

The local specific string is automatically resolved.

But: how can I achieve the same programmatically? Load the string from the styles definition, automatically in the correct localisation?

Answer Source

Whenever you retrieve the String using the Context it will return the locale dependent one.


You can see more from the documentation here.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download