使用自定义 ArrayAdapter 时无法解析超级方法
can't resolve method super when using custom ArrayAdapter
我正在尝试将 ListView 与自定义 ArrayAdapter 一起使用,但是当我尝试在构造函数中调用 super 时,它给了我这个错误:
cannot resolve method'(android.content.Context, int, java.lang.String)
这是我的一段代码
public class MobileArrayAdapter extends ArrayAdapter<String> {
private final Context context;
private final String values;
public MobileArrayAdapter(Context context, String values) {
super(context, R.layout.activity_second,values);
this.context = context;
this.values = values;
}
我错过了什么?感谢 return!
您的构造函数应该在 super 中传递一个字符串数组或字符串数组列表。
错误提示您没有仅以字符串作为参数的超级构造函数
我正在尝试将 ListView 与自定义 ArrayAdapter 一起使用,但是当我尝试在构造函数中调用 super 时,它给了我这个错误:
cannot resolve method'(android.content.Context, int, java.lang.String)
这是我的一段代码
public class MobileArrayAdapter extends ArrayAdapter<String> {
private final Context context;
private final String values;
public MobileArrayAdapter(Context context, String values) {
super(context, R.layout.activity_second,values);
this.context = context;
this.values = values;
}
我错过了什么?感谢 return!
您的构造函数应该在 super 中传递一个字符串数组或字符串数组列表。
错误提示您没有仅以字符串作为参数的超级构造函数