dimanche 19 avril 2015

How to set baseurl correctly in Android WebView?

I am using WebView to display some html content from web (using loadDataWithBaseUrl() method). The html data could be any html content, simple plain text or rich html with img tags. I inject some JavaScript also in WebView which sets some style and does html manipulation. Now the problem is that sometimes JavaScript does not load in the WebView. It happens when the html data contains some images. Also, sometimes images in the html does not load. I tried setting a dummy baseurl (http://dummy.baseurl) in loadDataWithBaseUrl() which solves the JavaScript loading issue. But the image loading issue is still remains.


Am I setting the baseurl correctly? Is there any other baseurl I can set which will help?


Aucun commentaire:

Enregistrer un commentaire