我已经声明了 ArrayList 之类的,
var otherSeriesList = ArrayList<String>()
并尝试通过关注从资源中获取数据,
otherSeriesList = ArrayList<String>(Arrays.asList(resources.getStringArray(R.array.get_other_series)))
我应该如何从资源字符串数组创建 ArrayList?
最佳答案
简单的这样做-
otherSeriesList = ArrayList<String>(Arrays.asList(*resources.getStringArray(R.array.get_other_series)))
* 将数组作为可变参数传递
关于android - 从资源字符串数组创建 ArrayList<String>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48207631/