The main problem why it didn't work in the first place, was, that you basically created a List<IntArray>. You need to use the spread operator (*) to get a List<Int>, i.e. the following would have worked too: val integers = Arrays.asList(*disabledNos). A similar question, that also mentions the actual error: Convert Array<String> to ArrayList<String>
List<IntArray>. You need to use the spread operator (*) to get aList<Int>, i.e. the following would have worked too:val integers = Arrays.asList(*disabledNos). A similar question, that also mentions the actual error: ConvertArray<String>toArrayList<String>