how we can get the arraylist(both string and integer) from the resources xml

前端 未结 5 1661
太阳男子
太阳男子 2020-12-29 20:22

Hi want to get the arraylist from the resources.xml is there any code for this.please give me some suggestions.Thanks in advance

5条回答
  •  既然无缘
    2020-12-29 21:07

    Not entirely sure what you want, but this might be worth a read: http://developer.android.com/guide/topics/resources/string-resource.html

    
    
        
            Mercury
            Venus
            Earth
            Mars
        
    
    

    How to retrieve the array in your application with code:

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

提交回复
热议问题