I have a java question about a HashMap with an ArrayList in it. The key is a string and the value is the ArrayList (HashMap<String, ArrayList<Object>>)
I am given a list of multiple keys and I need to put the corresponding values into the ArrayList, and I'm not sure how to do it.
Here's an example:
(What I am given)
ABC
ABC
ABC
123
123
The keys are actually file names so the file is the value for the ArrayList. Now I have to separate those filenames so i can add the files to the ArrayList. Does this make sense?
This is the only code I have:
Set<String> tempModels = Utils.getSettingSet("module_names", new HashSet<String>(), getActivity());
for(String s : tempModels) {
Log.d("Loading from shared preferences: ", s);
String key = s.substring(0, 17);
}
map.get(key).add(value)check for nullput()