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:
parent
7346643fb9
commit
f985f4132d
|
@ -290,16 +290,16 @@ public class RemoteActivity extends BaseActivity
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean dispatchKeyEvent(KeyEvent event) {
|
public boolean dispatchKeyEvent(KeyEvent event) {
|
||||||
if (event.getAction() != KeyEvent.ACTION_DOWN)
|
boolean handled = false;
|
||||||
return 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
|
||||||
// Show volume change dialog if the event was handled and we are not in
|
if (handled && (viewPager.getCurrentItem() != 0)) {
|
||||||
// first page, which already contains a volume control
|
new VolumeControllerDialogFragmentListener()
|
||||||
if (handled && (viewPager.getCurrentItem() != 0)) {
|
.show(getSupportFragmentManager(), VolumeControllerDialogFragmentListener.class.getName());
|
||||||
new VolumeControllerDialogFragmentListener()
|
}
|
||||||
.show(getSupportFragmentManager(), VolumeControllerDialogFragmentListener.class.getName());
|
|
||||||
}
|
}
|
||||||
return handled || super.dispatchKeyEvent(event);
|
return handled || super.dispatchKeyEvent(event);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue