views:

439

answers:

2

Hi.

In my Application, I display data in webview but it can't display the images in the webview.

I used loadDatawithBaseURL() method.

This is my code..

webview.loadDataWithBaseURL("file:///059600656X/", data, "text/html", "UTF-8", "about:blank");

// here data is a string object which contain html parsing data.

I think it cant find the images in given directory.

Can Anybody help me?

A: 

You cannot use simple file:/// URLs with loadDataWithBaseURL(), and "about:blank" probably is not a valid base URL.

CommonsWare
ok I remove that still the same problem/
Addy
A: 

To make the loadDataWithBaseURL work you need to make sure of two things:

All image src include "file:///android_asset/imagename"

and the images are in the asset folder!!

So contrary to answer1, it is as simple as that!

Munir Syed