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;
}
}