i have a probleme , that i have a text from json , i parse it , but i need to pic image from this text, and this is the json text :
"posts": [
{
"id": 22201,
"type": "post",
"slug": "basket-le-wac-simpose-65-a-42-face-au-cmc",
"url": "http://www.wydadnews.com/?p=22201",
"status": "publish",
"title": "Basket: Le WAC s’impose 65 à 42 face au CMC",
"title_plain": "Basket: Le WAC s’impose 65 à 42 face au CMC",
"content": "<p><img alt=\"null\" src=\"http://dl.dropboxusercontent.com/u/60787184/basket8373.jpg\" align=\"left\" />Le Wydad a battu, ce soir, le CMC 65 à 42 en match comptant pour la 8e journée du championnat. Les Wydadis enchainent ainsi leur 7e victoire consécutive en championnat, sur 7 matchs disputés. <a href=\"http://www.wydadnews.com/?p=22201#more-22201\" class=\"more-link\">Read more</a></p>\n",
"excerpt": "Le Wydad a battu, ce soir, le CMC 65 à 42 en match comptant pour la 8e journée du championnat. Les Wydadis enchainent ainsi leur 7e victoire consécutive en championnat, sur 7 matchs disputés.",
"date": "2013-04-10 21:38:41",
"modified": "2013-04-11 11:23:26",
and we have into " content " the url
<p><img alt=\"null\" src=\"http://dl.dropboxusercontent.com/u/60787184/basket8373.jpg\" align=\"left\" />
and i want from this text pic the picture and display it with the text , if some one can help me i don't know how to do it , i try but nothing happened .
this is my code of pars json ,
public static Article parseArticle(JSONObject jsonArticle) {
Article article = new Article();
try {
article.setTitle(ArabicUtilities.reshape(Html.fromHtml(
jsonArticle.getString("title")).toString()));
article.setExcerpt(ArabicUtilities.reshape(Html.fromHtml(
jsonArticle.getString("excerpt")).toString()));
article.setContent(ArabicUtilities.reshape(Html.fromHtml(
jsonArticle.getString("content")).toString()));
article.setDate(jsonArticle.getString("date"));
return article;
} catch (JSONException e) {
e.printStackTrace();
return null;
}
}
public static ArrayList<Article> parseArticles(String str) {
JSONObject json = null;
ArrayList<Article> list = new ArrayList<Article>();
if (str == null)
return list;
try {
JSONArray array;
json = new JSONObject(str);
array = json.getJSONArray("posts");
for (int i = 0; i < array.length(); i++) {
Article node = parseArticle(array.getJSONObject(i));
list.add(node);
}
return list;
} catch (JSONException e) {
e.printStackTrace();
return null;
}
}
and this is my adapter
@Override
public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = (LayoutInflater)
getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.list_item, null);
TextView txtArticleTitle = (TextView) view.findViewById(R.textviews.txtArticleTitle);
TextView txtArticleExcerpt = (TextView) view.findViewById(R.textviews.txtArticleExcerpt);
TextView txtArticleDate = (TextView) view.findViewById(R.id.textArticleDate);
Article article = getItem(position);
txtArticleTitle.setText(ArabicUtilities.reshape(article.getTitle()));
txtArticleExcerpt.setText(ArabicUtilities.reshape(article.getExcerpt()));
txtArticleDate.setText(article.getDate().toGMTString());
return view;
}
and this is show just the text .