Fixed issue where back button would not exit the activity if bootstrap installation failed and users dismissed the error dialog,

This commit is contained in:
agnostic-apollo
2021-06-28 09:26:42 +05:00
parent e408fdcc08
commit 9c92251595
2 changed files with 11 additions and 1 deletions

View File

@@ -245,6 +245,13 @@ public class TermuxTerminalViewClient extends TermuxTerminalViewClientBase {
@Override
public boolean onKeyUp(int keyCode, KeyEvent e) {
// If emulator is not set, like if bootstrap installation failed and user dismissed the error
// dialog, then just exit the activity, otherwise they will be stuck in a broken state.
if (keyCode == KeyEvent.KEYCODE_BACK && mActivity.getTerminalView().mEmulator == null) {
mActivity.finishActivityIfNotFinishing();
return true;
}
return handleVirtualKeys(keyCode, e, false);
}