Android4.4 posturl,然后在webView里面打开了另一个网页,goback()报500

小沛沛 发布于 2015/02/09 16:39
阅读 1K+
收藏 0
WebSettings webSettings = mWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setSupportZoom(true);
webSettings.setBuiltInZoomControls(true);
webSettings.setCacheMode(WebSettings.LOAD_DEFAULT);
// webSettings.setDefaultTextEncodingName("GBK");
mWebView.setWebChromeClient(new WebChromeClient() {
@Override
public void onProgressChanged(WebView view, int newProgress) {
if (newProgress < 100) {
mPrgBar.setProgress(newProgress);
mPrgBar.setVisibility(View.VISIBLE);
} else {
mPrgBar.setVisibility(View.GONE);
}
}
});
mWebView.setWebViewClient(new WebViewClient() {
private final static String PAY_CALL_BACK = "gxq/app/payresult";
private final static String ASSET_CALL_BANK = "gxq/app/property";


private final static String AUTH_SUCCEED = "gxq/app/authSuccess";
private final static String AUTH_FAILED = "gxq/app/authFail";
private final static String PAY_FAILED = "gxq/app/payfailed";


@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url.contains(PAY_CALL_BACK)) {
mActivity
.doEvent(GxqEventNormalModel.EVENT_NROMAL_MAIN_ASSET);
} else if (url.contains(ASSET_CALL_BANK)) {
mActivity
.doEvent(GxqEventNormalModel.EVENT_NROMAL_MAIN_ASSET);
} else if (url.contains(AUTH_SUCCEED)) {
mActivity.finish();
showSucceedDialog("支付认证开通中");
} else if (url.contains(AUTH_FAILED)) {
mActivity.finish();
showErrorDialog("支付认证开通失败");
} else if (url.contains(PAY_FAILED)) {
mActivity.finish();
} else {
// loadUrlInWebView(url);
mHeader.setTitle(mWebView.getTitle());
return false;
}
return true;
}
});
加载中
0
唐朝栗子工作室
你是想重写返回键?按下返回键,返回上一层,而不是退出浏览器吗
返回顶部
顶部