Are "strings.xml" string arrays always parsed/deserialized in the same order?
Posted
by
PhilaPhan80
on Stack Overflow
See other posts from Stack Overflow
or by PhilaPhan80
Published on 2012-04-06T04:50:32Z
Indexed on
2012/04/06
5:29 UTC
Read the original article
Hit count: 114
Can I count on string arrays within the "strings.xml" resource file to be parsed/deserialized in the same order every time?
If anyone can cite any documentation that clearly spells out this guarantee, I'd appreciate it. Or, at the very least, offer a significant amount of experience with this topic.
Also, is this a best practice or am I missing a simpler solution?
Note: This will be a small list, so I'm not looking to implement a more complicated database or custom XML solution unless I absolutely have to.
<!--KEYS (ALWAYS CORRESPONDS TO LIST BELOW ??)-->
<string-array name="keys">
<item>1</item>
<item>2</item>
<item>3</item>
</string-array>
<!--VALUES (ALWAYS CORRESPONDS TO LIST ABOVE ??)-->
<string-array name="values">
<item>one</item>
<item>two</item>
<item>three</item>
</string-array>
© Stack Overflow or respective owner