I have the following code
public abstract class BaseAdapter<T, V extends BaseAdapter.ViewHolder> extends ArrayAdapter<T> {
public BaseAdapter(Context context, int resource, Collection<T> collection) {
// typical constructor logic
}
// some other custom defined methods
public static class ViewHolder {
// custom defined logic
}
}
public class ModelAdapter extends BaseAdapter<Model, ModelAdapter.ModelViewHolder> {
public ModelAdapter(Context context, int resource, Collection<Model> collection) {
super(context, resource, collection);
// typical constructor logic
}
public static class ModelViewHolder extends ViewHolder {
// custom defined logic
}
}
The BaseAdapter and ModelAdapter are in separated files. The problem is that I have a compilation error when trying to define the ModelAdapter:
ModelViewHolder is not accessible in current context
I don't really understand this error and can't figure out what I am doing wrong. Can somebody explain to me this problem or a link that may clarify this situation?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…