From fd99c5e4615e7f8d6522ace29cd5c49c9fd7e012 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Thu, 30 Jan 2025 19:36:38 +0100 Subject: [PATCH] MainActivity: Fix onBackPressed handling for open player The change b9dd7078ad3ae2ac1c20969fdd8b97736026b7dc accidentally moved the `return` into the `{}`, so the logic would fall through to ``` if (fragmentManager.getBackStackEntryCount() == 1) {` ``` and close the app even though there are still items on the `VideoFragmentDetail` stack. To reproduce: Start video, enqueue another video, then start a third video (which adds one entry to the stack), and press `back` on the expanded video. This should keep the player open and go back to the first 2-video queue, but it actually closes the app before this fix. --- app/src/main/java/org/schabi/newpipe/MainActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/MainActivity.java b/app/src/main/java/org/schabi/newpipe/MainActivity.java index 39431537d..2f393994b 100644 --- a/app/src/main/java/org/schabi/newpipe/MainActivity.java +++ b/app/src/main/java/org/schabi/newpipe/MainActivity.java @@ -569,8 +569,8 @@ public class MainActivity extends AppCompatActivity { if (player instanceof BackPressable backPressable && !backPressable.onBackPressed()) { BottomSheetBehavior.from(mainBinding.fragmentPlayerHolder) .setState(BottomSheetBehavior.STATE_COLLAPSED); - return; } + return; } if (fragmentManager.getBackStackEntryCount() == 1) {