diff --git a/app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt b/app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt index aebd0141b..a41fcd656 100644 --- a/app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt @@ -280,12 +280,16 @@ class SearchActivity : VMBaseActivity(R.layout.activity_book_se */ @Synchronized private fun upSearchItems(items: List, isMandatoryUpdate: Boolean) { - if (!isMandatoryUpdate && System.currentTimeMillis() - refreshTime < 1000) { + if (!isMandatoryUpdate && System.currentTimeMillis() - refreshTime < 500) { return } refreshTime = System.currentTimeMillis() - val diffResult = DiffUtil.calculateDiff(DiffCallBack(adapter.getItems(), items)) - adapter.setItems(items, diffResult) + try { + val diffResult = DiffUtil.calculateDiff(DiffCallBack(adapter.getItems(), items)) + adapter.setItems(items, diffResult) + } catch (e: Exception) { + e.printStackTrace() + } } /**