我正在爲我的列表視圖做一個自定義arrayAdapter,但像我的超級構造函數這樣的簡單事情搞砸了我!Android自定義arrayadapter構造函數問題
private ArrayAdapter<ScheduleTime> timeHold;
//make proper constructor, see use ticket types
public TimeTableAdapter(Context context, int textViewResourceId,
ArrayAdapter<ScheduleTime> timesTable) {
super(context, textViewResourceId, timesTable);
this.timeHold = timesTable;
}
我上super
行錯誤:
super(context, textViewResourceId, timesTable);
The constructor SimpleAdapter(Context, int, ArrayAdapter<ScheduleTime>) is undefined
缺少什麼我在這裏?我的上述構造函數顯然具有所有這些元素
當它說'構造函數SimpleAdapter(Context,int,ArrayAdapter)是未定義的,這意味着它們是錯誤的**元素。它*告訴你你有這些元素,但是沒有爲簡單適配器定義。正如@JB Nizet所說,一個簡單的適配器有不同的'super'參數。 –
Kgrover