-1

To get a string from the resourses in android using java i use

  Resources res=this.getResources();
    String ch=res.getString(R.string.naeme);

but now i want to add a string to strings.xml using java code , how to do that ?

1
  • You can't really change the values in resources programmatically, can you describe what are you trying to achieve so that I can help Commented Sep 5, 2018 at 19:25

1 Answer 1

5

strings.xml is a constants file and it can't be modified at run time. Hence you can't write any string to strings.xml file

Use shared preference to store any string if needed

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.