kutukoff
kutukoff

Reputation: 43

How To Change String Resource Xml Values?

I need help, How To Change String Resource Xml Values at new value? I have <string name="pref_way">/mnt/sdcard/</string> and change at new value in programming <string name="pref_way">/mnt/sdcard/ext_sd</string>

Upvotes: 0

Views: 164

Answers (2)

Bogdan Alexandru
Bogdan Alexandru

Reputation: 5552

You can't change a String resource (or any other type of XML-declared resources) at runtime. Create a String variable in one of you classes that initializes with the resource String and you may change that at your will.

Upvotes: 0

Andro Selva
Andro Selva

Reputation: 54330

You can't modify any files in res dynamically during run time. They are read-only.

Instead for this kind of purpose I would recommend you to go for Shared Preference.

Upvotes: 3

Related Questions