Hi, Antonio Gutierrez!
Ruslan Arslanov
42

Hi Ruslan,

Yes, using Dagger will clean the way dependencies are injected, but I did not include this other libraries in order to keep the approach focus and clean.

I would only do a remark regarding using Dagger. Probably you are filling the injections in Fragment#onCreate , but you need to be aware that following the Loader approach only the first time the Presenter would need to be injected, since in the rotation the old Presenter is retain.

If you want to avoid that Dagger creates for you a Presenter instance every time, you could use Dagger’s Lazy, which defers instantiation until the first call to Lazy<T>’s get(). In this way you will avoid creating unnecessary Presenters.

Show your support

Clapping shows how much you appreciated Antonio Gutierrez’s story.