2011-12-22 65 views
0

我試圖加載一些字符串到一個列表視圖,虐待稍後獲取單獨的數據類。我只想現在顯示一些文字,但我似乎是做錯了:加載一個包含數據的列表視圖

 ArrayList<HashMap<String, String>> aList = new ArrayList<HashMap<String, String>>(); 

     ListAdapter adapter = new SimpleAdapter(this, aList , R.layout.main, 
       new String[] { "test", "test", "test", "test" }, 
       new int[] { R.id.item_title, R.id.item_subtitle, R.id.item_time, R.id.item_date }); 

      setListAdapter(adapter); 

      final ListView lv = getListView(); 
      lv.setTextFilterEnabled(true); 
+0

什麼是你的logcat錯誤? – Sujit 2011-12-22 09:46:33

+0

即時通訊沒有看到任何錯誤,它只是不顯示數據 – MaikelS 2011-12-22 09:49:25

回答

0

aList是空的,所以不會顯示任何數據。你應該填充它以便查看任何數據。

相關問題