android - Calling A List of a Hashmap of a list. (Java) -


this variable

private arraylist<hashmap<string, string>> usersinfo = new arraylist<hashmap<string, string>>(); 

i keep adding info usersinfo

hashmap.put(tag_username, data_obj.getstring(tag_username)); usersinfo.add(hashmap); 

how can print array or print index info put in it?

you can print values of arraylist follows:

userinfo.stream.foreach((map)-> {     for(string key : map.getkeys()){         system.out.println("key: " + key + ", value: " + map.get(key));     } }) 

or if want specific map @ index, use following:

map map = userinfo.get(0); for(string key : map.getkeys()){     system.out.println("key: " + key + ", value: " + map.get(key)); } 

Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -