방법 1)
val loArr = mutableListOf(
ModelLocation(),
ModelLocation(),
ModelLocation(),
ModelLocation(),
ModelLocation()
)
loarr.set(id, weatherArr[0])
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
방법 1 은 mutableLisfOf 에서 객체로 만들어서 하면 값이 잘 들어 가는데
하지만 개수를 지정하지 않고 하려고 방법 2 로 초기화 해서 하니 값이 들어가지 않습니다 ㅠㅠ
위 방법으로 객체개수를 지정하지 않고 초기화 하는 방법 없나요 ?
방법 2)
var loArr: MutableList< ModelLocation> = mutableListOf()
loarr.set(id, weatherArr[0])