参考以下代码。我想知道为什么我需要放入一个对象而不是字符串中的所有对象。此代码来自自定义 ListView 适配器。
公共 ArrayAdapter(上下文上下文,int textViewResourceId,T[] 对象)
工作正常
public ListViewAdapter(Context context, String[] first, String[] second, String[] third) {
super(context, R.layout.listview_item, first);
this.context = context;
this.first = first;
this.second = second;
this.third = third;
}
如果我这样做会出错。
public ListViewAdapter(Context context, String[] first, String[] second, String[] third) {
super(context, R.layout.listview_item, first, second, third);
this.context = context;
this.first = first;
this.second = second;
this.third = third;
}
错误:构造函数 ArrayAdapter(Context, int, String[], String[], String[]) 未定义
原始来源
public class ListViewAdapter extends ArrayAdapter<String> {
Context context;
String[] first;
String[] second;
String[] third;
LayoutInflater inflater;
public ListViewAdapter(Context context, String[] first, String[] second, String[] third) {
super(context, R.layout.listview_item, first);
this.context = context;
this.first = first;
this.second = second;
this.third = third;
}