我在使用共享点站点时遇到问题。我已经对其 ntlm auth 进行了身份验证,并将整个站点转换为字符串,一旦我将其加载到 WebView 中,loadData();
我就看不到图像了。我认为它与 .axd 文件扩展名有关,因为它隐藏了图像的完整 url。
问问题
754 次
1 回答
0
我知道如何解决它:
package com.example.yourapp;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.net.http.SslError;
import android.os.Bundle;
import android.webkit.*;
@SuppressLint({ "SetJavaScriptEnabled", "NewApi" })
public class Sharepoint extends Activity {
private WebView webView;
@SuppressLint("NewApi")
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.sharepoint);
CookieSyncManager.createInstance(this);
CookieManager cookieManager = CookieManager.getInstance();
String cook = null;
cookieManager.setCookie("yoursite", cook);
CookieSyncManager.getInstance().sync();
webView = (WebView) findViewById(R.id.webView);
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("yoururl");
}
}
于 2014-12-03T10:45:26.007 回答