android version:4.2
my sample code is:
try {
//HttpResponse response = httpClient.execute(httpGet, localContext);
HttpResponse response = httpClient.execute(httpGet, localContext);
HttpEntity entity = response.getEntity();
text = getASCIIContentFromEntity(entity);
text=text.replaceAll("<", "<").replace(">", ">").replace(" ", " ");
int start=text.indexOf("<message>");
start=start+9;
int end=text.indexOf("</message>");
text=text.substring(start, end);
JSONArray ja = new JSONArray(text) ;
// ITERATE THROUGH AND RETRIEVE CLUB FIELDS
int n = ja.length();
for (int i = 0; i < 1; i++) {
// GET INDIVIDUAL JSON OBJECT FROM JSON ARRAY
JSONObject jo = ja.getJSONObject(i);
title+= jo.getString("Title")+",";
url= jo.getString("URL");
desc= jo.getString("Description");
}
} catch (Exception e) {
return e.getLocalizedMessage();
}
issue: Varible desc(i.e., description in my json)contains ** ** in its contents.I have converted HTML into string in android using following code:
Spanned marked_up = Html.fromHtml(results);
tv2.setText(marked_up.toString(),BufferType.SPANNABLE);
Still it is not replacing ** **.
Help me anyone plz.
ThankYou in advance.
1 Answer