我是相當新的android開發,當我嘗試用片段我得到一個錯誤的適配器的工作,我試着寫下onCreateView
的Android - 適配器的碎片問題
valueAdapterEn = new ValueAdapterEn(English_list, this);
這個錯誤是這條線在本節(English_list, this)
ValueAdapterEn
public class ValueAdapterEn extends BaseAdapter implements Filterable {
private ArrayList<String> English_List;
private ArrayList<String> Filterd_EngList;
private LayoutInflater mInflater;
private ValueFilter valueFilter;
public ValueAdapterEn(ArrayList<String> English_List, Context context){
this.English_List = English_List;
this.Filterd_EngList = English_List;
mInflater = LayoutInflater.from(context);
getFilter();
}
@Override
public int getCount() {
return 0;
}
@Override
public Object getItem(int position) {
return null;
}
@Override
public long getItemId(int position) {
return 0;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
return null;
}
@Override
public Filter getFilter() {
return null;
}
}
logcat的
Error:(84, 30) error: constructor ValueAdapterEn in class ValueAdapterEn cannot be applied to given types;
required: no arguments
found: ArrayList<String>,TwoFragment
reason: actual and formal argument lists differ in length
的問題可能是 '本'
您是否創建了** ValueAdapterEn **? –
@AparajitaSinha當然我有 –
請分享您的LogCat信息錯誤 –