24

I have my primary string resource file for android, and it is quite full (with no end in sight). So, I was hoping to do some house cleaning and move some string into their own resource file. Is this possible?

I know that one can have something like string-en or string-de, but is it possible to maybe have a resource file such as string-errors?

Joshua Ulrich
  • 173,410
  • 32
  • 338
  • 418
ahodder
  • 11,353
  • 14
  • 71
  • 114
  • Alreday answered here http://stackoverflow.com/questions/13922522/are-there-any-side-effects-of-using-multiple-string-xml-files – ketankk Jun 08 '16 at 08:48
  • 4
    @SultanMirza My question was asked first... almost 5 years ago. – ahodder Jun 08 '16 at 20:01

1 Answers1

36

Apparently so. I just took a small app of mine, created a new XML file, values/labels.xml, and moved some of my string resources from values/strings.xml into it. I made no other changes to the app; it still worked fine.

David Conrad
  • 15,432
  • 2
  • 42
  • 54
  • 9
    As long as the strings in the new file are still defined using the xml tags, you can have as many resource files as you want. You still reference them in the same way as before, with `R.string.string_name` – theisenp Sep 23 '11 at 15:53
  • Yup, I made no other changes, so it still had to be referenced the same way. Thanks to theisenp for clarifying. – David Conrad Sep 23 '11 at 16:34