Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I can make string to be a reference to another string just like that:

<resources>  
    <string name="my_string">My String</string>  
    <string name="my_alias">@string/my_string</string>  
</resources>  

And i tried to make string-array reference the same way:

<string-array name="my_string_array">
   <item>1</item>
   <item>2</item>
   <item>3</item>
</string-array>

<string-array name="my_string_array_alias">@array/my_string_array</string-array>

But this does not work, unfortunately. I tried to use this array and alias in ListPreference:

<ListPreference
   android:key="my_key"
   android:title="@string/my_title"
   android:entries="@array/my_string_array_alias"
   android:entryValues="@array/my_string_array"
   android:dialogTitle="@string/my_dialog_title" />

and entries is just an empty array. Of course, i can make both entries and entryValues to take the same array, but i like it to be a different ones.

share|improve this question

1 Answer 1

Found this on the Android dev site.

Note: Not all resources offer a mechanism by which you can create an alias to another resource. In particular, animation, menu, raw, and other unspecified resources in the xml/ directory do not offer this feature.

It's a little vague but I believe this means the framework doesn't support it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.