0

I tried to inject DispatchAsync in Presenter class's onBind() method.

@Inject
DispatchAsync dispatchAsync;

But, its null while I try to invoke execute inside dispatchAsync.onBind() method.

I need to get details from server while loading.

What can I do for this or can I use this statement in onbind() method or any other place in presenter.

Thanks in Advance, Bennet.

Bennet
  • 387
  • 1
  • 6
  • 13

1 Answers1

1

You should inject it like this

private final DispatchAsync dispatchAsync;

@Inject
Presenter(...., DispatchAsync dispatchAsync) {
   super(...);

   this.dispatchAsync = dispatchAsync;
}

This way you get the dispatchAsync injected in your presenter.

spg
  • 9,309
  • 4
  • 36
  • 41
Michael
  • 32,527
  • 49
  • 210
  • 370