You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Biggest problem for me when using DaggerAppCompatActivity is that there is no good way of handling data in savedInstanceState object or some other configuration change behaviours.
In AddEditTaskActivity, mIsDataMissing is extracted from savedInstanceState and can be accessed through method isDataMissing(). This method must be public as it is called from AddEditTaskModule. It finally must be called by AddEditTaskPresenter using Dagger Lazy functionality in a specific place - in takeView method - because if it is called any sooner, that variable will not be set in AddEditTaskActivity at all.
Another example is TasksActivity, where filter type in TasksPresenter is set through contract TasksContract.Presenter method setFiltering.
I guess that there is no unified way of initializing Presenter class or handling various Android specifics, like configuration changes, saving instance state etc. Therefore, I think that DaggerAppCompatActivity usage brings more "mess" to the code than simply calling good old inject method on Activity's onCreate method, where custom module parameters can be set and finally passed to Presenters constructor in a clear injection way.
Please correct me if I am wrong.
The text was updated successfully, but these errors were encountered:
Biggest problem for me when using
DaggerAppCompatActivity
is that there is no good way of handling data insavedInstanceState
object or some other configuration change behaviours.In
AddEditTaskActivity
,mIsDataMissing
is extracted fromsavedInstanceState
and can be accessed through methodisDataMissing()
. This method must be public as it is called fromAddEditTaskModule
. It finally must be called by AddEditTaskPresenter using Dagger Lazy functionality in a specific place - intakeView
method - because if it is called any sooner, that variable will not be set inAddEditTaskActivity
at all.Another example is
TasksActivity
, where filter type inTasksPresenter
is set through contractTasksContract.Presenter
methodsetFiltering
.I guess that there is no unified way of initializing
Presenter
class or handling various Android specifics, like configuration changes, saving instance state etc. Therefore, I think thatDaggerAppCompatActivity
usage brings more "mess" to the code than simply calling good oldinject
method on Activity'sonCreate
method, where custom module parameters can be set and finally passed toPresenter
s constructor in a clear injection way.Please correct me if I am wrong.
The text was updated successfully, but these errors were encountered: