Created
July 5, 2011 04:03
-
-
Save itoz/1064234 to your computer and use it in GitHub Desktop.
Android リソースの配列を取得
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
ex) | |
<string-array name="entries0"> | |
<item>値1</item> | |
<item>値2</item> | |
<item>値3</item> | |
<item>値4</item> | |
</string-array> | |
*/ | |
String[] array =getResources().getStringArray(R.array.entries0); | |
int max = array.length; | |
for (int i = 0; i < max; i++) { | |
Log.v("tag", String.valueOf("------" + array[i])); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment