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 d11dbe6853
This commit is contained in:
Synced Synapse 2018-07-20 12:37:25 +01:00 committed by Martijn Brekhof
parent 7346643fb9
commit f985f4132d
1 changed files with 9 additions and 9 deletions

View File

@ -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);
}