我正在使用 LoadUrl 将 SharePoint 页面加载到 web 视图中。所有其他内容都会下降,但图像不会下降。该站点需要 cookie 才能登录,但该部分工作正常,只要您通过登录页面,下一页是正确的减去图像。
字符串 myUrl = " https://www.mysite.com/ ";
CookieSyncManager.createInstance(this);
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.setCookie(myUrl, cook);
CookieSyncManager.getInstance().sync();
webView = (WebView)findViewById(R.id.webView1);
webView.setWebViewClient(new WebViewClient()
{
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error)
{
handler.proceed();
}
public void onProgressChanged(WebView view, int progress)
{
}
});
webView.getSettings().setDomStorageEnabled(true);
webView.getSettings().setAllowContentAccess(true);
webView.getSettings().setAllowFileAccess(true);
webView.getSettings().setAllowUniversalAccessFromFileURLs(true); webView.getSettings().setLoadsImagesAutomatically(true);
webView.getSettings().setBuiltInZoomControls(true);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setAppCacheEnabled(true);
try {
Thread.sleep(300);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
webView.loadUrl(myUrl);