今晚在给Listview配上Adapters后运行,出现致命错误,崩溃了
查看console发现NULLPOINTERERROR,原因在getCount的return listDatas.size();
看来是listDatas没赋值,于是
public class MyAdapter extends BaseAdapter{
private List<Poirot> listDatas;
public int getCount() {
listDatas=new ArrayList<Poirot> ();
//add this
return listDatas.size();
}
}