2012-04-13 6 views
0

私はAndroidのグローバル文字列にstrings.xmlを使用する方法を知っていますが、String []についてはどうですか?Android:文字列でres/valuesを使用する

これを使用する可能性はありますか?

ありがとうございます。

答えて

2

あなたは参照してくださいhere

の内側とXML文字列配列を意味している場合arrays.xmlと呼ばれる自分の価値観のフォルダ内のファイルを作成してのstrings.xmlで直接この

<string-array name="colors"> 
    <item>red</item> 
    <item>orange</item> 
    <item>yellow</item> 
    <item>green</item> 
    <item>blue</item> 
    <item>violet</item> 
</string-array> 
+0

ありがとうございます –

2

ないようなあなたの配列を作成しますが、のようなものこれは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> 
+0

ありがとうございました... –

関連する問題