Is it possible for us to implement a HashMap with one key and two values. Just as HashMap?
Please do help me, also by telling (if there is no way) any other way to
String key= "services_servicename"
ArrayList data;
for(int i = 0; i lessthen data.size(); i++) {
HashMap servicesNameHashmap = new HashMap();
servicesNameHashmap.put(key,data.get(i).getServiceName());
mServiceNameArray.add(i,servicesNameHashmap);
}
I have got the Best Results.
You just have to create new HashMap
like
HashMap servicesNameHashmap = new HashMap();
in your for
loop. It will have same effect like same key and multiple values.