首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > XML SOAP >

Android xml资料里读取string array

2012-08-14 
Android xml文件里读取string arrayexample:XML file saved at res/values/strings.xml : ? xml version

Android xml文件里读取string array
example:XML file saved at res/values/strings.xml : <? xml version = "1.0" encoding = "utf-8" ?>

<resources>     <string-array name = "planets_array" >         <item> Mercury </item>         <item> Venus </item>         <item> Earth </item>         <item> Mars </item>     </string-array> </resources>


This application code retrieves a string array:

Resources res = getResources () ; String [] planets = res . getStringArray ( R . array . planets_array );

热点排行