我的ANDROID应用程序有问题.
我想在我的网页浏览中显示一个推特页面,但该网址无法打开.
它无限加载.
我正在使用sdk 1.6.
webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setLoadsImagesAutomatically(true); webView.setBackgroundColor(0x00000000); webView.getSettings().setAllowFileAccess(true); webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); final Activity activity = this; webView.setWebChromeClient(new WebChromeClient() { public void onProgressChanged(WebView view, int progress) { activity.setProgress(progress * 100); Log.e("progress",progress+" "+((progress * 100))); if(progress==100) { //getWindow().setFeatureInt(Window.FEATURE_PROGRESS,Window.PROGRESS_VISIBILITY_OFF); indicator.setVisibility(View.GONE); } else { indicator.setVisibility(View.VISIBLE); } } }); webView.getSettings().setUseWideViewPort(true); webView.setWebViewClient(new ApplicationWebViewClient()); } private class ApplicationWebViewClient extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return super.shouldOverrideUrlLoading(view, url); }
小智.. 13
wv.getSettings().setDomStorageEnabled(true);
这对我有用!
wv.getSettings().setDomStorageEnabled(true);
这对我有用!
我必须在webview上设置用户代理字符串才能使其工作.
wv.getSettings()setUserAgentString( "silly_that_i_have_to_do_this");
这对我有用.
希望它可以帮助别人!