Closed Jogan closed 8 years ago
Probably the confusion here is due to a poor naming from me side. Maybe onInitializePresenter would be a better one. The idea behind onPresenterPrepared is to provide a hook for the fragment implementation to grab a reference to the restored/created Presenter before the view gets attached, so any additional data can be pass to the Presenter. I usually use attaching and detaching of the view in the Presenter as the callbacks to start any Presenter work (eg: start a background job, populate view content, etc), so by that time the Presenter should contain any needed information for its work.
Ah interesting good to know thanks!
In onLoadFinished() of the BasePresenterFragment you call:
onPresenterPrepared(presenter);
beforepresenter.onViewAttached(getPresenterView());
I would think this might potentially cause an issue if you call the presenter in the onPresenterPrepared method of the fragment before the view is attached.