Answer the question
In order to leave comments, you need to log in
How to properly use generic types?
I need the attach method to accept a class that inherits from BaseCompatActivity. What did I do wrong because Android Studio throws an error
public interface BaseMvpPresenter <T extends BaseCompatActivity>{
boolean isAttached = false;
void attach(T view);
void detach();
}
public class BasePresenter <T extends BaseCompatActivity> implements BaseMvpPresenter {
private T view;
private boolean isAttached = false;
@Override
public void attach(T view) {
this.view = view;
isAttached = true;
}
@Override
public void detach() {
view = null;
isAttached = false;
}
}
Answer the question
In order to leave comments, you need to log in
The text of the error says that you did something wrong.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question