public class GridViewAdapter {
private Context mcontext;
private int layoutResourceId;
public GridViewAdapter(Context context, int layoutResourceId, ArrayList<Listitem> listitem) {
super(context, layoutResourceId, listitem);
this.layoutResourceId = layoutResourceId;
this.mcontext =context;
}
这是第二个错误
cannot resolve method getitem()
` Listitem item = getItem(position);`
if (row == null) {
LayoutInflater inflater = LayoutInflater.from(mcontext);
row = inflater.inflate(layoutResourceId, parent, false);
holder = new ViewHolder();
holder.imageTitle = (TextView) row.findViewById(R.id.text);
holder.imageView = (ImageView) row.findViewById(R.id.imageView);
row.setTag(holder);
} else {
holder = (ViewHolder) row.getTag();
}
Listitem item = getItem(position);
最佳答案
super
尝试调用super class
。您没有扩展任何内容,因此隐式地,您是从Object
继承的,而又没有这样的构造函数(接受三个参数的构造函数)
变化
public class GridViewAdapter {
具有
public class GridViewAdapter extends ArrayAdapter<ListItem> {