We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 70f9224 commit 2c193baCopy full SHA for 2c193ba
1 file changed
pythonforandroid/bootstraps/qt/build/src/main/java/org/kivy/android/PythonActivity.java
@@ -123,8 +123,10 @@ public void onDestroy() {
123
124
@Override
125
public boolean onKeyDown(int keyCode, KeyEvent event) {
126
- // If it wasn't the Back key or there's no web page history, bubble up to the default
127
- // system behavior (probably exit the activity)
+ if (keyCode != KeyEvent.KEYCODE_BACK) {
+ return super.onKeyDown(keyCode, event);
128
+ }
129
+
130
if (SystemClock.elapsedRealtime() - lastBackClick > 2000) {
131
lastBackClick = SystemClock.elapsedRealtime();
132
Toast.makeText(this, "Click again to close the app", Toast.LENGTH_LONG).show();
0 commit comments