0

I know how to use strings.xml for global strings in Android, but what's about the String[] ?

Is there any possibility to use this and if there is, how?

Thank you.

2 Answers 2

2

If you meant String arrays inside and xml refer here

Create a file in your values folder called arrays.xml and create your array like this

<string-array name="colors">
    <item>red</item>
    <item>orange</item>
    <item>yellow</item>
    <item>green</item>
    <item>blue</item>
    <item>violet</item>
</string-array>
Sign up to request clarification or add additional context in comments.

Comments

2

Not Directly in strings.xml, but something like this can be done in string.xml:

<string name="string1">str1</string>
<string name="string2">str2</string>

<string-array name="system">
    <item>@string/string1</item>
    <item>@string/string2</item>
</string-array>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.