Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/185.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 在hashmap中作为值包含的hashmap上迭代_Android_Hashmap - Fatal编程技术网

Android 在hashmap中作为值包含的hashmap上迭代

Android 在hashmap中作为值包含的hashmap上迭代,android,hashmap,Android,Hashmap,我有一个父HashMap 喜欢 Hashmap 现在,通过查找第一个hashmap,即父hashmap,可以得到如下值 键1------[子位图的键(值)] 键2------[子位图的键(值)] . . . 现在我想迭代hashmap,它是基于父hashmap的键的值 我如何才能做到这一点。 .这应该可以: for (Map.Entry<String, HashMap<String, ArrayList<CustomClass>> entry : outer

我有一个父HashMap 喜欢
Hashmap
现在,通过查找第一个hashmap,即父hashmap,可以得到如下值

键1------[子位图的键(值)] 键2------[子位图的键(值)] . . . 现在我想迭代hashmap,它是基于父hashmap的键的值

我如何才能做到这一点。 .

这应该可以:

    for (Map.Entry<String, HashMap<String, ArrayList<CustomClass>> entry : outerHashMap.entrySet()) {
String entryKey= entry.getKey();
// ...
for (Map.Entry<String, ArrayList<CustomClass> nestedentry : entry.getValue().entrySet()) {
    String name = nestedEntry.getKey();
    ArrayList<CustomClass> value = nestedEntry.getValue();
    // ...
}
}
for(Map.Entry