i have a simple method that takes a generic List parameter but for some reason my IDE(Eclipse) states how it cannot be resolved?
Am i doing something wrong here
private OnClickListener removeFieldListener(final LinearLayout layout,
List<T> viewList) {
return new OnClickListener() {
@Override
public void onClick(View v) {
int indexToDelete = layout.indexOfChild(v);
}
};
}
In that case, the T parameter has to be defined somewhere. As I guess your class does not declares this parameter, you have to put it in your method declaration, like
But this will only move the problem to the caller of this method …