为什么我的代码回出现空指针
public class JsonAdapter extends BaseAdapter {
private List<ListMenu> classList;
private Context context;
private LayoutInflater inflater;
public JsonAdapter(Context context,List<ListMenu> classList) {
this.context = context;
this.classList=classList;
inflater = LayoutInflater.from(context);
}
public JsonAdapter(Context context) {
this.context = context;
inflater = LayoutInflater.from(context);
}
public void setData(List<ListMenu> classlist) {
this.classList = classlist;
}
@Override
public int getCount() {
return classList.size();
}
说是在getCount()这里出现空指针,求大神解惑