From e7198ad92e7e4885e09af843f09bbc70889d4219 Mon Sep 17 00:00:00 2001 From: Rahul Patel Date: Sun, 15 Oct 2023 05:54:21 +0530 Subject: [PATCH] SearchFilter: Resolve ConcurrentModificationException --- https://gitlab.com/AuroraOSS/AuroraStore/-/issues/839 --- .../com/aurora/store/view/ui/search/SearchResultsFragment.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/aurora/store/view/ui/search/SearchResultsFragment.kt b/app/src/main/java/com/aurora/store/view/ui/search/SearchResultsFragment.kt index 4c49b14f5..44a47994f 100644 --- a/app/src/main/java/com/aurora/store/view/ui/search/SearchResultsFragment.kt +++ b/app/src/main/java/com/aurora/store/view/ui/search/SearchResultsFragment.kt @@ -288,8 +288,11 @@ class SearchResultsFragment : BaseFragment(R.layout.fragment_search_result), } private fun filter(appList: MutableList): List { + val tempList:MutableList = mutableListOf() + tempList.addAll(appList) + filter = FilterProvider.with(requireContext()).getSavedFilter() - return appList + return tempList .asSequence() .filter { it.displayName.isNotEmpty() } // Some of the apps may not have metadata .filter { if (!filter.paidApps) it.isFree else true }