Here I have fetched data from server/json and populated my ArrayList
ArrayList<HashMap<String, String>> newsUpdateList = new ArrayList<HashMap<String, String>>();
private static final String TAG_NEWSCAPTION = "caption";
private static final String TAG_NEWSDATE = "date";
HashMap<String, String> newsUpdate = new HashMap<String, String>();
//adding each child node to HashMap key => value
newsUpdate.put(TAG_NEWSCAPTION, newsCaption);
newsUpdate.put(TAG_NEWSDATE, newsDate);
newsUpdateList.add(newsUpdate);
Somewhere else (within my Adapter Class), I want to populate a ListView using this data, and i get the data like:
HashMap<String, String> newsItem = newsUpdateList.get(position);
And then in building the individual List items, I have two TextViews in which i have to load the news caption, and news date.
TextView caption = (TextView) v.findViewById(R.id.newsCaption);
TextView date = (TextView) v.findViewById(R.id.newsDate);
Here's the problem, what is the proper way the extract the caption and date from the
HashMap<String, String> newsItem
Any ideas, ...new to JAVA and Android :)