问题
I have a project that depends on third-party library (aar). I want to change some strings in this library (they are defined in strings.xml of the library). Is it possible to override these string values without dealing with library source code? (id of the string resource is known).
回答1:
Yes, you can do it, but you have to override all languages in which the string is written.
Assume that the following string is in a third-party library in res/values
folder.
<string name="msg">Message</string>
And this is in the library res/values-it
folder:
<string name="msg">Messaggio</string>
You have to override both in your app, so, in your res/values
folder, you can do:
<string name="msg">My new string</string>
And in res/values-it
, you can do:
<string name="msg">La mia stringa</string>
来源:https://stackoverflow.com/questions/43694575/is-it-possible-to-override-android-string-resource-from-external-aar-library