我创建了以下类型的 HashMap HashMap<String, List<String>>,并为其添加值,如下所示:
ListView lv = (ListView)findViewById(R.id.list);
HashMap<String, List<String>> hm = new HashMap<String, List<String>>();
List<String> values = new ArrayList<String>();
for (int i = 0; i < j; i++) {
    values.add(value1);
    values.add(value2);
    hm.put(key, values);
}
我想检索数据,将其解析为 ListAdapter,然后解析为 ListView。这是列表视图的 xml:
<ListView
    android:id="@+id/list"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"/>
和列表项的 xml:
 <!-- for the key value -->
 <TextView
        android:id="@+id/id"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
         />
    <!-- For Value 1 -->
    <TextView
        android:id="@+id/value1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
         />
      <!-- For Value 2 -->
    <TextView
        android:id="@+id/name"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
         />
如何从 hashMap 中检索数据,将其放入 ListAdapter,然后将其设置为 ListView?