找不到符号构造函数 ArrayAdapter(android.content.Context,int,java.lang



我正在扩展 ArrayAdapter:

public class ImgItemAdapter extends ArrayAdapter<ImageData>

我正在尝试实现其构造函数:

public ImgItemAdapter(Context context, int textViewResourceId, String[] imageArray) {
        super(context, textViewResourceId, imageArray);
        inflator = ((Activity)context).getLayoutInflater();
        imgUrlArray = imageArray;
    }

问题是 - 当我尝试编译时,它给了我这个错误消息:

Error:(28, 9) cannot find symbol constructor ArrayAdapter(android.content.Context,int,java.lang.String[])

有什么想法吗?

这是我的源代码:示例代码

您正在调用super(context, textViewResourceId, imageArray);并且收到该错误,这意味着具有所提供参数的此类构造函数在ArrayAdapter的超类中不存在。另请查看文档以查看构造函数的正确参数。

相关内容

最新更新