kagomez
02/17/2020, 6:20 PMwhen (deeplink.lastPathSegment) {
BRANCHES_SEGMENT -> presenter.loadBranches()
else -> updateHomeState(screenState = HomeScreenState.HomeScreen)
}
the presenter is being injected on the Activity and on onStart and onCreate the presenter instance has not been initiliazed yetaipok
02/17/2020, 7:12 PMpresenter
is initialized?kagomez
02/18/2020, 12:07 AMprivate val presenter: IHomeViewContract.Presenter by inject()
And this other chunk the way I defined on the module
factory<IHomeViewContract.Presenter> { HomePresenter(resourceProvider = get(), serviceProvider = get(), analytics = get() }
It’s not crashingtynn
02/18/2020, 7:27 AMkagomez
02/18/2020, 1:22 PMkagomez
02/18/2020, 4:36 PMaipok
02/18/2020, 4:50 PMget
call in the block there you are using the presenter. Does the presenter has some long running initialization? This could be the reason why it is not there at the time you want to use it.
Also this will not keep the instance until activity is being destroyed. Unless of cause, if you are using it in some other methods of your activity.kagomez
02/18/2020, 5:22 PMget
I see how it develops.kagomez
02/19/2020, 12:02 PM