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 2cf9cae3d..ae44ddaad 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 @@ -76,6 +76,9 @@ class SearchActivity : VMBaseActivity(R.layout.activity_book_se !getPrefBoolean(PreferKey.precisionSearch) ) precisionSearchMenuItem?.isChecked = getPrefBoolean(PreferKey.precisionSearch) + search_view.query.toString().trim()?.let { + search_view.setQuery(it, true) + } } R.id.menu_source_manage -> startActivity() else -> if (item.groupId == R.id.source_group) { @@ -85,6 +88,9 @@ class SearchActivity : VMBaseActivity(R.layout.activity_book_se } else { putPrefString("searchGroup", item.title.toString()) } + search_view.query.toString().trim()?.let { + search_view.setQuery(it, true) + } } } return super.onCompatOptionsItemSelected(item)