can i create string.xml file dynamically in android? -


this question has answer here:

i want implement "settings" section in application, , want when user selects whatever, 1 of strings string.xml change value according user selection. possible @ all? ideas on how implement it?

you can't create strings.xml dynamically.

but can following: create stringmanager.java hashmap strings. store user defined values in map key / value pairs. key original string strings.xml

public string getstring(int key) { *check if string in map *if not in map: return key's value, (eg.: getresources().getstring(resid)), user happy *if key present return user defined value }

//call settings section setstring(int key, string value) { // key string defined in strings.xml, value user defined value. }

you have implement kind of save/load methods make changes permanent.

whenever there text field user can change have set text this:

sometextfield.settext(stringmanagerobject.getstring(resid));


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -