Android Resources edit

Define string array

In order to define a string array write in a resources file

res/values/filename.xml

<string-array name="string_array_name">
    <item>text_string</item>
    <item>@string/string_id</item>
</string-array>

for example

res/values/arrays.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string-array name="string_array_example">
        <item>@string/app_name</item>
        <item>@string/hello_world</item>
    </string-array>
</resources>

and use it from java like

String[] strings = getResources().getStringArray(R.array.string_array_example;
Log.i("TAG",Arrays.toString(strings)));

Output

I/TAG: [HelloWorld, Hello World!]

Table Of Contents
9 Resources
39 ACRA
64 Menu
112 Loader
119 Xposed
132 Colors
135 Fresco
140 AdMob
147 Button
156 Vk SDK
170 XMPP
176 OpenCV
200 FileIO
203 Moshi
217 Paint
231 AIDL
241 JCodec
243 Okio
255 Looper
  ↑ ↓ to navigate     ↵ to select     Esc to close