// while user using back key open previously page (if exist)
webView.setOnKeyListener(new View.OnKeyListener() {
@Override
public boolean onKey(View view, int keyCode, KeyEvent keyEvent) {
if (keyEvent.getAction() == KeyEvent.ACTION_DOWN) {
switch (keyCode) {
case KeyEvent.KEYCODE_BACK: {
if (webView.canGoBack()) {
webView.goBack();
}
}
}
}
return false;
}
});
CodeBase
baza kodu i informacji
CodeBase
baza kodu i informacji