参考下面的代码。我想知道为什么我需要放入一个对象而不是所有的字符串中的对象。此代码来自自定义ListView适配器。ListView的公共ArrayAdapter
public ArrayAdapter (Context context, int textViewResourceId, T[] objects)
做工精细
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(上下文,INT的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;
}
'super'呼吁要扩展的类的构造函数,如果你看看你所提供的链接,你会看到它不存在。 – AlexBcn 2013-04-29 09:30:23