I have some conditions in which I have to change some resources in strings.xml file. Is there a way to do that programatically, without pushing an updated version of the app?
2 Answers
No you cant. One solution is to use SharedPrefences instead.
1 Comment
Basit
It answers my question, thanks! I cannot use
SharedPreferences in this case. Will have to opt for a different approach int this case.You cannot change the values of any resources after the app has been compiled, as the references are generated at this time.
You will have to handle this using some logic directly in your code. Something like:
if (condition)
set something not from resources
else
use resource for text
1 Comment
Basit
Yeah! Those resource IDs cannot be modified at run time. I'm opting a different option here. Thank you for your response.
Shared Preferences