* Prevent library double initialization
@@ -78,7 +78,7 @@ public class CheckoutActivity extends PXActivity<CheckoutPresenter>
private Intent customDataBundle;
public static Intent getIntent(@NonNull final Context context) {
- return new Intent(context, CheckoutActivity.class);
+ return new Intent(context, CheckoutActivity.class).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
}
@Override
@@ -86,11 +86,21 @@ public class CheckoutActivity extends PXActivity<CheckoutPresenter>
super.onCreate(savedInstanceState);
setContentView(R.layout.px_activity_checkout);
if (savedInstanceState == null) {
+ initPresenter();
+ }
+ }
+
+ @Override
+ protected void onNewIntent(final Intent intent) {
+ super.onNewIntent(intent);
+ initPresenter();
+ }
+
+ private void initPresenter() {
presenter = getActivityParameters();
presenter.attachView(this);
presenter.initialize();
}
- }
@Override
protected void onSaveInstanceState(final Bundle outState) {
