From f985f4132d720382f752aaf4967b68044ecb500f Mon Sep 17 00:00:00 2001 From: Synced Synapse Date: Fri, 20 Jul 2018 12:37:25 +0100 Subject: [PATCH] Fix back button not exiting the app when on the remote activity Hitting the back button in the remote activity was being ignored, thus preventing exiting the app. This issue was inadvertidely introduced in d11dbe68531f8e9f17cbbead11fa4a879eb89ee4 --- .../ui/sections/remote/RemoteActivity.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/org/xbmc/kore/ui/sections/remote/RemoteActivity.java b/app/src/main/java/org/xbmc/kore/ui/sections/remote/RemoteActivity.java index 58f4416..2fdc0df 100644 --- a/app/src/main/java/org/xbmc/kore/ui/sections/remote/RemoteActivity.java +++ b/app/src/main/java/org/xbmc/kore/ui/sections/remote/RemoteActivity.java @@ -290,16 +290,16 @@ public class RemoteActivity extends BaseActivity */ @Override public boolean dispatchKeyEvent(KeyEvent event) { - if (event.getAction() != KeyEvent.ACTION_DOWN) - return false; + boolean handled = false; + if (event.getAction() == KeyEvent.ACTION_DOWN) { + handled = VolumeControllerDialogFragmentListener.handleVolumeKeyEvent(this, event); - boolean handled = VolumeControllerDialogFragmentListener.handleVolumeKeyEvent(this, event); - - // Show volume change dialog if the event was handled and we are not in - // first page, which already contains a volume control - if (handled && (viewPager.getCurrentItem() != 0)) { - new VolumeControllerDialogFragmentListener() - .show(getSupportFragmentManager(), VolumeControllerDialogFragmentListener.class.getName()); + // Show volume change dialog if the event was handled and we are not in + // first page, which already contains a volume control + if (handled && (viewPager.getCurrentItem() != 0)) { + new VolumeControllerDialogFragmentListener() + .show(getSupportFragmentManager(), VolumeControllerDialogFragmentListener.class.getName()); + } } return handled || super.dispatchKeyEvent(event); }