创建适配器映像时无法应用对象中的object()

Mou*_*diz 3 android

我正在创建一个适配器映像,并且出现以下2个错误:

这是代码

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;

    }
Run Code Online (Sandbox Code Playgroud)

这是第二个错误

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);
Run Code Online (Sandbox Code Playgroud)

Bla*_*elt 5

super尝试调用super class。您什么都没有扩展,所以隐式地,您从继承Object而后者又没有此类构造函数(带有三个参数的构造函数)

更改

public class GridViewAdapter {
Run Code Online (Sandbox Code Playgroud)

public class GridViewAdapter extends ArrayAdapter<ListItem> {
Run Code Online (Sandbox Code Playgroud)