Is it possible in Dagger to do something like the following:
public abstract class Presenter<T extends BaseView> {
@Inject T mView;
public void showLoadingIndicator() {
mView.showLoading();
}
}
(example module)
public class MyModule {
private MyView mView; //extends BaseView
public MyModule(MyView view) {
mView = view;
}
@Provides
public BaseView provideView() {
return mView;
}
}
And then create an object graph with the module above and inject the view into the presenter?
My attempts have not worked (usually get "unknown class 'T'" sort of errors). I'm not sure if my configuration is wrong or if this is unsupported functionality.