Created
November 21, 2019 02:43
-
-
Save imammubin/ddb5eb54dcc8d2e40077d2d4df4fb948 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public boolean onKeyDown(int keyCode, KeyEvent event){ | |
if(event.getAction()==KeyEvent.ACTION_DOWN){ | |
switch (keyCode){ | |
case KeyEvent.KEYCODE_BACK: | |
if(webView.canGoBack()){ | |
webView.goBack(); | |
}else{ | |
finish(); | |
} | |
return true; | |
} | |
} | |
return super.onKeyDown(keyCode, event); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment