Question

I have a multilanguage application that uses the standard xml files to provide string values in different laguages.

...
res/values/strings.xml
res/values-es/strings.xml
res/values-pt/strings.xml
...

What I want to do is override the normal behavior of Android to look for a resource somewhere else before looking into the standard xml files.

So when the code calls getResources().getString() a custom code would look into an alternative resource file before falling back into the standard getString implementation.

Is there any way to achieve this?

thanks!

Était-ce utile?

La solution

Is there any way to achieve this?

No. For your own invocations of getString(), you can wrap those calls in your own code to check "somewhere else".

Autres conseils

The part you intend to achieve is not possible as Android by default would look only i the res folder for the required resources.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top