2

I am new in android development.i have to parse data from xml.my xml url is- http://mobileecommerce.site247365.com/admin/catdata.xml

i am able to success parse cat_desc data.Can i show whole data in webview or webview can display only url?

Rais Alam
  • 6,970
  • 12
  • 53
  • 84
arpit
  • 555
  • 1
  • 7
  • 25

3 Answers3

5

Use this, it is the correct answer, as sometimes it is possible it wont show the web view due to some special chas like % and # etc... so use this :-

webview.loadDataWithBaseURL("<some URL>", stringData,"text/html", "utf-8", null);
mAc
  • 2,434
  • 2
  • 22
  • 39
2

You can display data in a WebView using

webview.loadData(yourString, "text/html", "utf-8");
Sherif elKhatib
  • 45,786
  • 16
  • 89
  • 106
0

There are two methods for display string data in WebView,

either

webview.loadData( stringData, "text/html", "utf-8");

or

webview.loadDataWithBaseURL("<some URL>", stringData,"text/html", "utf-8", null);
user370305
  • 108,599
  • 23
  • 164
  • 151
  • In your case I think you have to try, webview.loadDataWithBaseURL("http://mobileecommerce.site247365.com", stringData,"text/html", "utf-8", null); – user370305 Oct 20 '11 at 07:09