Skip to content

Commit fd99c5e

Browse files
committed
MainActivity: Fix onBackPressed handling for open player
The change b9dd707 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.
1 parent 407d2d7 commit fd99c5e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/src/main/java/org/schabi/newpipe/MainActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,8 +569,8 @@ public void onBackPressed() {
569569
if (player instanceof BackPressable backPressable && !backPressable.onBackPressed()) {
570570
BottomSheetBehavior.from(mainBinding.fragmentPlayerHolder)
571571
.setState(BottomSheetBehavior.STATE_COLLAPSED);
572-
return;
573572
}
573+
return;
574574
}
575575

576576
if (fragmentManager.getBackStackEntryCount() == 1) {

0 commit comments

Comments
 (0)