Issue
I have to pass whole html tag in webview.
My url is- http://mobileecommerce.site247365.com/admin/catdata.xml
I parse cat_desc , please check url for first cat_desc
public class WebviewActivity extends Activity
{
WebView mWebView;
String s="first cat_desc from url";
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
showPdf();
}
private void showPdf()
{
WebView webview = new WebView(this);
setContentView(webview);
webview.getSettings().setJavaScriptEnabled(true);
webview.loadData(s, "text/html", "utf-8");
}
}
Solution
Read about xml parsers. Then you can check how to set the HTML code in the cat_desc tag into your webview.
You can read about xml parsing in android here.
Another option is, you can try to substring out the cat_desc tag content using regular string methods (substring, indexOf). Use the method you are comfort with.
Answered By - Jong
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.