我不斷收到此錯誤http://prntscr.com/3qygj9(對不起,我不能複製和粘貼)從該段代碼填充列表視圖與一個ArrayList
final ArrayList<HashMap<String, String>> foodList = db.getAllFood();
if(foodList.size() != 0){
ListView listView = (ListView) findViewById(R.id.foodListView);
ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(
this,
android.R.layout.simple_list_item_1,
foodList);
listView.setAdapter(arrayAdapter);
}
我不能爲我的生命弄清楚爲什麼。提前致謝!