1

我在 Android 2.3、Galaxy S 上收到此错误。

[ERROR] Uncaught Error: Too much time spent in unload handler. -- From line 1 of v8/DateExtension

我在 Android 4.0.3 上试过,效果很好。

它只发生在旧版本的 Android 上。

我不知道如何复制这个问题,但我在我的代码中使用了 jQuery。

4

1 回答 1

0
 I got same error after some investigating i have solved this issue may be this code will helpful for you 
        {
            webView = (WebView) view.findViewById(R.id.transcationwebview);
                progressdialog = ProgressDialog.show(mContext, "",
                        mContext.getString(R.string.please_wait));
                progressdialog.setCancelable(true);
                progressdialog.setOnCancelListener(new OnCancelListener() {

                    @Override
                    public void onCancel(DialogInterface dialog) {
                        webView.stopLoading();
                        // webView.clearView();

                    }
                });



                webView.setWebChromeClient(new MyChromeClient());
                webView.getSettings().setBuiltInZoomControls(true);
                webView.getSettings().setLayoutAlgorithm(
                        WebSettings.LayoutAlgorithm.NARROW_COLUMNS);
                webView.getSettings().setUseWideViewPort(true);
                webView.getSettings().setLoadWithOverviewMode(true);
                webView.setWebViewClient(new WebViewClient() {
                    @Override
                    public boolean shouldOverrideUrlLoading(WebView view, String url) {
                        // TODO Auto-generated method stub
                        // view.loadUrl(url);
                        return false;
                    }

                    @Override
                    public void onPageFinished(WebView view, String url) {
                        // TODO Auto-generated method stub
                        super.onPageFinished(view, url);
                        if (progressdialog != null && progressdialog.isShowing()) {
                            progressdialog.dismiss();
                        } 

                    }

                    @Override
                    public void onPageStarted(WebView view, String url, Bitmap favicon) {
                        // TODO Auto-generated method stub
                        super.onPageStarted(view, url, favicon);
                    }

                    @Override
                    public void onReceivedError(WebView view, int errorCode,
                            String description, String failingUrl) {
                        // TODO Auto-generated method stub



                    }
                });
                webView.getSettings().setLoadWithOverviewMode(true);
                webView.getSettings().setPluginState(PluginState.ON);
                webView.getSettings().setBuiltInZoomControls(true);
                webView.getSettings().setPluginsEnabled(true);
                webView.setKeepScreenOn(true);
                webView.getSettings().setDomStorageEnabled(true);
                webView.getSettings().setAppCacheEnabled(true);
                webView.getSettings().setJavaScriptEnabled(true);
                webView.loadUrl(url);
}
    public class MyChromeClient extends WebChromeClient {
            @Override
            public void onProgressChanged(WebView view, int newProgress) {
                try {

                    if (progressdialog.isShowing()) {
                        progressdialog.setMessage(getString(R.string.loading)
                                + newProgress + " %");

                    } else {
                        /*
                         * webView.stopLoading(); webView.clearView();
                         */
                    }
                } catch (Throwable e) {

                    e.printStackTrace();
                }
            }
于 2013-11-08T13:54:56.950 回答