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

前端 未结 5 1646
太阳男子
太阳男子 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:13

    A modification to Klaus' answer, to get an ArrayList:

    ArrayList myResArrayList = new ArrayList();
    Resources res = getResources();
    Collections.addAll(myResArrayList, res.getStringArray(R.array.myResArray));
    

提交回复
热议问题