Android : Getting key/pair values from HashMap

on Wednesday, October 1, 2014


Let us suppose that we add a link from an RSS Feeder into a HashMap as follows.



if (currentChild.getNodeName().equalsIgnoreCase("link")) {
//L.m(currentChild.getTextContent());
currentMap.put("link", currentChild.getTextContent());


}


In other words our HashMap containts a key/value pairs as shown...



("link",http://........),
("link",http://........),
("link",http://........) and so on....


Now I want to extract those links in the following method..



@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
// TODO Auto-generated method stub



}


I want to open the links in WebViews. I did something similar,but was saving data like titles and links into a simple ArrayList..Now I am trying something similar with HashMaps,and I am stuck.


Thank you in advance.


0 comments:

Post a Comment