Search code examples
androidxmlstringresourcesextending

Is it possible to extend string resources lookup in Android?


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!


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".