/** getting all recent articles and showing them in listview */ @Override protected String doInBackground(String... args) { // rss link url String rss_url = args[0]; // list of rss items rssItems = rssParser.getRSSFeedItems(rss_url); // looping through each item for (RSSItem item : rssItems) { // creating new HashMap HashMap<String, String> map = new HashMap<String, String>(); // adding each child node to HashMap key => value map.put(TAG_TITLE, item.getTitle()); map.put(TAG_LINK, item.getLink()); map.put(TAG_PUB_DATE, item.getPubdate()); String description = item.getDescription(); // taking only 200 chars from description if (description.length() > 100) { description = description.substring(0, 97) + ".."; } map.put(TAG_DESRIPTION, description); // adding HashList to ArrayList rssItemList.add(map); } // updating UI from Background Thread runOnUiThread( new Runnable() { public void run() { /** Updating parsed items into listview */ ListAdapter adapter = new SimpleAdapter( ListRSSItemsActivity.this, rssItemList, R.layout.rss_item_list_row, new String[] {TAG_LINK, TAG_TITLE, TAG_PUB_DATE, TAG_DESRIPTION}, new int[] {R.id.page_url, R.id.title, R.id.pub_date, R.id.link}); // updating listview setListAdapter(adapter); } }); return null; }