I always create different presenter/view for different fragments in an activity unless they share the same methods over some certain percentage. but to make thing more clean I believe creating things separately would be better.
1- You have to initialise your presenter inside onCreate() method of your Fragment. For this I always have a dependency registry class that is in charge of injection.
public void inject(ReportingHistoryDetailsFragment fragment, ReportingHistoryResponse.TaskBean taskBean) {
ReportingHistoryDetailsPresenter presenter = new ReportingHistoryDetailsPresenter(modelLayer,fragment,taskBean);
fragment.configureWith(presenter);
}
2- inside my fragment I call
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
DependencyRegistry.shared.inject(this, taskBean);
}
3- my Base view interface has
public interface BaseView <T> {
void configureWith(T presenter);
}
if you have multiple fragments being managed by an activity, each fragment implements your View interface and have a corresponding presenter which implements your Presenter interface.
hope this helps.