这是我的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?