比如在arrays.xml里:
<!--leo added for KYLIN-496-->
<string-array name="reboot_item">
<item>Reboot</item>
<item>Recovery</item>
<item>BootLoader</item>
</string-array>
在代码里获取:
String item0 =this.getResources().getStringArray(R.array.reboot_item)[0];
String item1 = this.getResources().getStringArray(R.array.reboot_item)[1];
CharSequence[] items = this.getResources().getStringArray(R.array.reboot_item);
时间: 2024-11-10 01:20:24