I am having a problem with a sharepoint site.
I have given it authentication for it's ntlm auth and converted the whole site into a string,
and once i load it into the WebView using loadData();
I can't see the images. I think it has something to do with the .axd file extenstion as it hides the full url of the images.
Asked
Active
Viewed 810 times
0

Kevin Tan
- 169
- 12
-
Try loading the data with the `loadDataWithBaseURL` instead of using `loadData` – Zyber Apr 24 '13 at 07:54
-
@Zyber, i tried that a while ago but the images does not load and is replaced by a question mark. – Kevin Tan Apr 24 '13 at 08:00
1 Answers
0
I know how to fix it:
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");
}
}

Anoniem
- 75
- 12