Skip to content

Commit

Permalink
fix: Removed the onBackPressed Bug in TransferProcessFragment
Browse files Browse the repository at this point in the history
  • Loading branch information
sridharjajoo authored and therajanmaurya committed Apr 12, 2018
1 parent d38b381 commit bf5e16d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.mifos.mobilebanking.ui.activities;

import android.os.Bundle;

import org.mifos.mobilebanking.R;
import org.mifos.mobilebanking.ui.activities.base.BaseActivity;
import org.mifos.mobilebanking.ui.fragments.SavingAccountsDetailFragment;
Expand All @@ -14,6 +13,7 @@
public class SavingsAccountContainerActivity extends BaseActivity {

private long savingsId;
public boolean transferSuccess = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand All @@ -25,4 +25,15 @@ protected void onCreate(Bundle savedInstanceState) {
showBackButton();
}

@Override
public void onBackPressed() {
int count = getSupportFragmentManager().getBackStackEntryCount();
if (count == 2 && transferSuccess == true) {
getSupportFragmentManager().popBackStack();
getSupportFragmentManager().popBackStack();
transferSuccess = false;
} else {
super.onBackPressed();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.mifos.mobilebanking.R;
import org.mifos.mobilebanking.models.payload.TransferPayload;
import org.mifos.mobilebanking.presenters.TransferProcessPresenter;
import org.mifos.mobilebanking.ui.activities.SavingsAccountContainerActivity;
import org.mifos.mobilebanking.ui.activities.base.BaseActivity;
import org.mifos.mobilebanking.ui.enums.TransferType;
import org.mifos.mobilebanking.ui.fragments.base.BaseFragment;
Expand Down Expand Up @@ -160,6 +161,7 @@ public void showTransferredSuccessfully() {
ivSuccess.setVisibility(View.VISIBLE);
btnClose.setVisibility(View.VISIBLE);
llTransfer.setVisibility(View.GONE);
((SavingsAccountContainerActivity) getActivity()).transferSuccess = true;
}

/**
Expand Down

0 comments on commit bf5e16d

Please sign in to comment.