android Json show only lasy item
- by 03uk
i have one problem, my json parser show only last item! But at Logcat i see all item's!
Can you help me?
@Override
protected void onPostExecute(JSONObject result) {
super.onPostExecute(result);
Log.d("Log", result.toString());
JSONObject jsn = result;
try {
JSONArray jarray = jsn.getJSONArray("item");
for (int i = 0; i < jarray.length(); i++){
JSONObject jsno = jarray.getJSONObject(i);
title.setText(Html.fromHtml("<a href=\""+jsno.getString("link")+"\">"+jsno.getString("title")+"</a>"));
cat.setText(jsno.getString("category"));
date.setText(jsno.getString("pubDate"));
desc.getSettings().setJavaScriptEnabled(true);
desc.getSettings().setDefaultTextEncodingName("charset=UTF-8"); desc.loadData(jsno.getString("description"), "text/html; charset=UTF-8", "utf-8");
}
} catch (JSONException e) {
e.printStackTrace();
}