Can you please let me know how to use Dagger when instantiating Presenter with injected parameters…
Prabin Timsina

(I’m away from a keyboard right now, so expect typos and syntax errors)

In my `Activity`, I declare a way to instantiate the `Presenter` lazily.

To do this, you’ll decare the `Presenter` in a dagger module normally, but in your Activity, you’ll add something like this:

`@Inject Lazy<YourPresenter> presenterProvider;`

So you’ll still have your check for if the retained `Presenter` is null, but instead of using `new` directly, you’d use the `presenterProvider.get()` method of your lazy presenter.

Like what you read? Give Craig Russell a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.