From 9e4e5a6ab1492212e7e24747083352066f1295c4 Mon Sep 17 00:00:00 2001 From: Nephys222 Date: Tue, 2 Aug 2022 19:18:44 +0500 Subject: [PATCH] searchBar fix 2 --- .../java/com/github/libretube/activities/MainActivity.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/github/libretube/activities/MainActivity.kt b/app/src/main/java/com/github/libretube/activities/MainActivity.kt index 1699efec8..9d5def8a8 100644 --- a/app/src/main/java/com/github/libretube/activities/MainActivity.kt +++ b/app/src/main/java/com/github/libretube/activities/MainActivity.kt @@ -186,8 +186,10 @@ class MainActivity : AppCompatActivity() { }) searchView.setOnCloseListener { - onBackPressed() - true + if (navController.currentDestination?.id == R.id.searchFragment) { + onBackPressed() + } + false } return super.onCreateOptionsMenu(menu) }