Issue
I am trying to parse JSON data which is in HTML format. I am not understanding how to implement it.
My JsonObject as shown below :
{"Content":
{
"PageContent":"<table cellpadding=\"1\" cellspacing=\"0\">\r\n\t<tr><td colspan=\"2\" style=\"font-weight:bold; font-style:italic; font-size:24px; color:Red; text-decoration:blink;\">Contact Us</td></table>"
}
}
I want to load jsonobject i.e. menuPageContent
which is HTML format to WebView.
Solution
Hope you know how to implement JSON Parsing in Android?
Still, here is a way to get menuPageContent
from above json:
String myJSONData = "place your data here";
JSONObject objJSON = new JSONObject(myJSONData);
JSONObject subObj = objJSON.getJSONObject("MenuContent");
String webData = subObj.getString("menuPageContent");
myWebView.loadData(webData, "text/html; charset=UTF-8", null);
Read more about WebView.
Answered By - Paresh Mayani
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.