代码如下所示:
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if(keyCode==KeyEvent.KEYCODE_BACK&&webView.canGoBack()){
webView.goBack();
return true;
}
return super.onKeyDown(keyCode, event);
}