众所周知,ArrayList一不小心就会报ConcurrentModificationException错误,于是尝试用Collections.synchronizedCollection
解决
val tabList: MutableList = mutableListOf()
tabList.add()
…
val list = Collections.synchronizedCollection(this)
synchronized(list) {
//…
}
众所周知,ArrayList一不小心就会报ConcurrentModificationException错误,于是尝试用Collections.synchronizedCollection
解决
val tabList: MutableList = mutableListOf()
tabList.add()
…
val list = Collections.synchronizedCollection(this)
synchronized(list) {
//…
}