Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,10 @@ public void onDestroy() {

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
// If it wasn't the Back key or there's no web page history, bubble up to the default
// system behavior (probably exit the activity)
if (keyCode != KeyEvent.KEYCODE_BACK) {
return super.onKeyDown(keyCode, event);
}

if (SystemClock.elapsedRealtime() - lastBackClick > 2000) {
lastBackClick = SystemClock.elapsedRealtime();
Toast.makeText(this, "Click again to close the app", Toast.LENGTH_LONG).show();
Expand Down
Loading