这是我的MVP实现:
public class OfferDetailsPdfActivity extends AppCompatActivity implements OnPageChangeListener, OfferDetailsPdfMvp.View {
private PdfPresenterImpl presenter;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
int offerId = 0;
if (extras != null) {
offerId = extras.getInt(Offer.ID);
}
presenter = PdfPresenterImpl.getInstance(this, offerId);
}
我现在想使用Moxy。
所以在Activity中进行更改。
public class OfferDetailsPdfActivity extends MvpAppCompatActivity implements OnPageChangeListener, OfferDetailsPdfMvp.View {
@InjectPresenter
PdfPresenterImpl presenter;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
int offerId = 0;
if (extras != null) {
offerId = extras.getInt(Offer.ID);
}
// how pass parameter to presenter?
// presenter = PdfPresenterImpl.getInstance(this, offerId);
}
现在我该怎样将参数 (context, offerId)
传递给 Presenter 呢?