How to fix concurrent modification exception in Kotlin
This is my code, in which I am adding data to a list: fun bindProcess(listOfDocId: MutableList<String>, isActvityLogEnabled: Boolean): Observable<MutableList<SearchResultModel>> { return Observable.create<MutableList<SearchResultModel>> { var filteredList =CopyOnWriteArrayList<SearchResultModel>()// mutableListOf<SearchResultModel>() val headerItem: SearchResultModel = SearchResultModel() headerItem.type = 0 headerItem.title = context.getString(R.string.top_matches_label) filteredList.add(headerItem) for (row in ContSyncApplication.getContacts()) { if (listOfDocId.contains(row.docId)) { val my
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.