What i need is to define some string array, then use items of that array as values for text attributes in layout for textfields. Something like this:
arrays.xml:
<string-array name="main_table">
<item>Mon</item>
<item>Tue</item>
<item>Wed</item>
<item>Thu</item>
<item>Fri</item>
<item>Sat</item>
<item>Sun</item>
</string-array>
layout.xml:
<TextView style="@style/txt.weekdays" android:text="@array/weekdays[0]" />
<TextView style="@style/txt.weekdays" android:text="@array/weekdays[1]" />
<TextView style="@style/txt.weekdays" android:text="@array/weekdays[2]" />
<TextView style="@style/txt.weekdays" android:text="@array/weekdays[3]" />
<TextView style="@style/txt.weekdays" android:text="@array/weekdays[4]" />
<TextView style="@style/txt.weekdays" android:text="@array/weekdays[5]" />
<TextView style="@style/txt.weekdays" android:text="@array/weekdays[6]" />
Example above doesn't work as i expected and just shows me textfields with text @array/weekdays[0], @array/weekdays[1] and so on. Only if i use array item without index it gets me first array's item for all text fields
<TextView style="@style/txt.weekdays" android:text="@array/weekdays" />
I'm not asking how to do the trick programmatically, but the way i wrote. I'm not using simple string resources because i need this array in my app anyway in other places, so using string resources will duplicate this array.