有以下类:
private class SimpleExistedTasksAdapter<CalendarTask> extends ArrayAdapter<CalendarTask> {
private Context context;
private List<CalendarTask> tasks;
public SimpleExistedTasksAdapter(Context context,
int textViewResourceId, List<CalendarTask> objects) {
super(context, textViewResourceId, objects);
this.context=context;
this.tasks=objects;
}
@Override
public View getView(int position, View view, ViewGroup group) {
LayoutInflater inflater=LayoutInflater.from(context);
View v=inflater.inflate(R.layout.existed_tasks_item_layout, null);
CalendarTask task=tasks.get(position);
TextView priorityView=(TextView)v.findViewById(R.id.textViewPriorityColorIndicator);
TextView title=(TextView)v.findViewById(R.id.textViewTaskTitle);
task.getPriority();
return null;
}
}
我遇到了以下问题:CalendarTask 类有 getPriority() 方法,但 Eclipse 告诉我“任务”只是对象,不包含除对象之外的任何方法(CalendarTask 有导入)。