0

I am using MVP+Dagge2 in my project. the project have a PaymentPresenter, when PaymentActivity invoke PaymentPresenter's method paymentsSize(), then it return 0 I sure the payments size is 1, because I invoked addPaymentToPayments method and already output to logcat.

 mPayments:[Payment{name='储值卡', data='8.00', bh=1, id='2'}]

sorry for my bad english, if my Question is unclear, tell me please.

PaymentComponent:

@ActivityScope
@Component(dependencies = AppComponent.class, modules = {PaymentModule.class})
public interface PaymentComponent {

   void inject(PaymentActivity activity);

}

PaymentModule:

    @Module
    public class PaymentModule {

    private final PaymentContract.View mView;
    private final Intent mIntent;


    public PaymentModule(PaymentContract.View view, Intent intent){
        mView = view;
        this.mIntent = intent;
    }

    @Provides
    PaymentContract.View providePaymentContractView(){
        return mView;
    }

    @Provides
    Intent provideIntent(){
        return mIntent;
    }

}
Jay Ou
  • 63
  • 2
  • 9
  • It is not that clear what your question is. If you're asking why `PaymentPresentoer` returns incorrect value, then post the relevant code (module, component, usage, etc.) – Vasiliy Aug 17 '16 at 07:32
  • Yes, the PayemtnPresenter returns incorrect value. I am doubt the methods of injected Presenter can't invoke on Activity. Because irrelevant code in PaymentPresenter is too mach, so I no post them. Whatevet, thanks for you ^-^ – Jay Ou Aug 17 '16 at 08:09

0 Answers0