Change String-Array in Strings.xml to ArrayList

前端 未结 4 1640
孤城傲影
孤城傲影 2020-12-08 09:17

I\'m developing an Android app. I need to convert a string array into an ArrayList. I\'ve read up on this, and all have cases where you add the values to the array in the ja

4条回答
  •  难免孤独
    2020-12-08 10:07

    If anybody wondering how to do the same in kotlin

    val universities = arrayListOf(*resources.getStringArray(R.array.universities))
    

    universities will be ArrayList

提交回复
热议问题