0

I have made a Webview app to load a online site in to the view. now i want to save the css and java script files into the app assets dictionary to save trafik and speed for the website. But i cant load the picture from the assets dictionary. can anyone tell me what i am doihng wrong?

mWebView.loadUrl("http://www.XXX.de/android/index.html");

here the html file on an server:

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Hallo</title>
</head>
<body>
<center>hans hallo</center>
<center><img src="file:////Android/data/com.news/files/weltuntergang.png" height="200" width="200"></center>
</body>
</html>
4

1 回答 1

0

利用

文件:///android_asset/

指向您的资产目录

代替

file:////Android/data/com.news/files/

可能您需要在 webview 中使用loadDatawithBaseurl才能顺利工作(根据我的经验和指南推荐)

于 2013-08-29T10:42:41.790 回答