开发者

difference between loadData() and loadDataWithBaseURL() in WebView class.....?

开发者 https://www.devze.com 2023-02-03 15:04 出处:网络
can anybody tell me the difference between loadData() and loadDataWithBaseURL() in WebView class. when i used 开发者_运维百科web.loadDataWithBaseURL(\"\",html, mimetype, encoding,\"\"); in my program

can anybody tell me the difference between loadData() and loadDataWithBaseURL() in WebView class.

when i used 开发者_运维百科web.loadDataWithBaseURL("",html, mimetype, encoding,""); in my program , where html is the string that contains hard coded html tags, its displaying just like as html page where as when i used loadData(html,mimetype,encoding) in my code the application is closing.

i read the API but could not understand it..... so please help me...

Thanks in Advance

Ash


In case someone comes across this, WebView.loadData seems to be broken:

http://code.google.com/p/android/issues/detail?id=1733#c23

http://code.google.com/p/android/issues/detail?id=3552

Variants of the solution suggested in the OP's question seems to be the workaround. I figure nulls are cheaper than "", so I used this:

web.loadDataWithBaseURL(null,html, "text/html", "utf-8",null);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号