0
Hy!樹形圖和列表視圖
我有一個樹狀圖,我想在地圖中的所有字符串設定到ListView
代碼:
TreeMap<String, Integer> map = json.getChannels(lv.getItemAtPosition(arg2).toString());
ListView lv2 = new ListView(Channellist.this);
Set st = map.keySet();
lv2.setAdapter(new ArrayAdapter<String>(Channellist.this,android.R.layout.simple_expandable_list_item_1,st));
我的問題是,一個ArrayAdapter不支持一組。
有沒有解決方案?
THX
更好 - 「ArrayList l = new ArrayList(st)」,它會自動添加所有元素。 – 2011-02-01 18:08:44