resource->values->strings.xml里定义字符串
定义单字符串:
<string name="app_name">abc123</string>
定义字符串数组:
<string-array name="map_style_array"> <item>MAPBOX_STREETS</item> <item>OUTDOORS</item> <item>SATELLITE</item> <item>SATELLITE_STREETS</item> <item>LIGHT</item> <item>DARK</item> <item>TRAFFIC_DAY</item> <item>TRAFFIC_NIGHT</item> </string-array>
字符串数组id:
r.array.xxx
字符串id:
r.string.xxx
字符串数组取值:
String strs [] = getResource().getStringArray(int id)
字符串取值:
String str = getResource().getString(int id);
标签:定义,int,getResource,数组,字符串,Android,id From: https://www.cnblogs.com/remix777/p/17586812.html