Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Commit

Permalink
resolve all multiple time activity launch issues
Browse files Browse the repository at this point in the history
  • Loading branch information
EGOR-IND committed Mar 13, 2021
1 parent 592099e commit 6419323
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,15 @@ void onRetry() {
void viewDepositAccounts() {
Intent intent = new Intent(getActivity(), DepositAccountsActivity.class);
intent.putExtra(ConstantKeys.CUSTOMER_IDENTIFIER, customerIdentifier);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(intent);
}

@OnClick(R.id.ll_loan_accounts)
void viewLoanAccounts() {
Intent intent = new Intent(getActivity(), LoanAccountsActivity.class);
intent.putExtra(ConstantKeys.CUSTOMER_IDENTIFIER, customerIdentifier);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(intent);
}

Expand All @@ -187,27 +189,31 @@ void updateCustomerStatus() {
void showIdentificationCards() {
Intent intent = new Intent(getActivity(), IdentificationsActivity.class);
intent.putExtra(ConstantKeys.CUSTOMER_IDENTIFIER, customerIdentifier);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(intent);
}

@OnClick(R.id.iv_customer_profile)
void showCustomerProfileImage() {
Intent intent = new Intent(getActivity(), CustomerProfileActivity.class);
intent.putExtra(ConstantKeys.CUSTOMER_IDENTIFIER, customerIdentifier);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(intent);
}

@OnClick(R.id.ll_activities)
void showCustomerActivities() {
Intent intent = new Intent(getActivity(), CustomerActivitiesActivity.class);
intent.putExtra(ConstantKeys.CUSTOMER_IDENTIFIER, customerIdentifier);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(intent);
}

@OnClick(R.id.ll_payroll)
void showPayrollActivity() {
Intent intent = new Intent(getActivity(), PayrollActivity.class);
intent.putExtra(ConstantKeys.CUSTOMER_IDENTIFIER, customerIdentifier);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(intent);
}

Expand All @@ -218,6 +224,7 @@ void editCustomer() {
intent.putExtra(ConstantKeys.CUSTOMER_ACTION, CustomerAction.EDIT);
intent.putExtra(ConstantKeys.CUSTOMER, customer);
intent.putExtra(ConstantKeys.CUSTOMER_IDENTIFIER, customerIdentifier);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(intent);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ void addCustomer() {
isNewCustomer = true;
Intent intent = new Intent(getActivity(), CreateCustomerActivity.class);
intent.putExtra(ConstantKeys.CUSTOMER_ACTION, CustomerAction.CREATE);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(intent);
}

Expand Down Expand Up @@ -321,6 +322,8 @@ public void onItemClick(View childView, int position) {
Intent customerDetailsIntent = new Intent(getActivity(), CustomerDetailsActivity.class);
customerDetailsIntent.putExtra(ConstantKeys.CUSTOMER_IDENTIFIER,
customers.get(position).getIdentifier());
customerDetailsIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
| Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivityForResult(customerDetailsIntent, CUSTOMER_STATUS);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ void viewCustomer() {
void createCustomer() {
Intent intent = new Intent(getActivity(), CreateCustomerActivity.class);
intent.putExtra(ConstantKeys.CUSTOMER_ACTION, CustomerAction.CREATE);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(intent);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ void createDepositAccount() {
Intent intent = new Intent(getActivity(), CreateDepositActivity.class);
intent.putExtra(ConstantKeys.CUSTOMER_IDENTIFIER, customerIdentifier);
intent.putExtra(ConstantKeys.DEPOSIT_ACTION, DepositAction.CREATE);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(intent);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ class GroupDetailsFragment : FineractBaseFragment() {
val intent = Intent(activity, CreateGroupActivity::class.java).apply {
putExtra(Constants.GROUP, group)
putExtra(Constants.GROUP_ACTION, GroupAction.EDIT)
flags = Intent.FLAG_ACTIVITY_SINGLE_TOP
}
startActivity(intent)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ class GroupListFragment : FineractBaseFragment(), OnItemClickListener {
override fun onItemClick(childView: View?, position: Int) {
val intent = Intent(context, GroupDetailsActivity::class.java).apply {
putExtra(Constants.GROUP, groupList[position])
flags = Intent.FLAG_ACTIVITY_SINGLE_TOP
}
startActivity(intent)
}
Expand All @@ -126,6 +127,7 @@ class GroupListFragment : FineractBaseFragment(), OnItemClickListener {
fun addGroup() {
val intent = Intent(activity, CreateGroupActivity::class.java).apply {
putExtra(Constants.GROUP_ACTION, GroupAction.CREATE)
flags = Intent.FLAG_ACTIVITY_SINGLE_TOP
}
startActivity(intent)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ void createIdentifier() {
Intent intent = new Intent(getActivity(), CreateIdentificationActivity.class);
intent.putExtra(ConstantKeys.CUSTOMER_IDENTIFIER, customerIdentifier);
intent.putExtra(ConstantKeys.IDENTIFICATION_ACTION, Action.CREATE);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(intent);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ void onRetry() {
void createNewLoan() {
Intent intent = new Intent(getActivity(), LoanApplicationActivity.class);
intent.putExtra(ConstantKeys.CUSTOMER_IDENTIFIER, customerIdentifier);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(intent);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ void showPlannedPayment() {
Intent intent = new Intent(getActivity(), PlannedPaymentActivity.class);
intent.putExtra(ConstantKeys.PRODUCT_IDENTIFIER, productIdentifier);
intent.putExtra(ConstantKeys.CASE_IDENTIFIER, caseIdentifier);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(intent);
}

Expand All @@ -153,6 +154,7 @@ void showDebtIncomeReport() {
Intent intent = new Intent(getActivity(), DebtIncomeReportActivity.class);
intent.putExtra(ConstantKeys.LOAN_CREDITWORTHINESSSNAPSHOTS, (new Gson()).toJson(
loanAccount.getLoanParameters().getCreditWorthinessSnapshots()));
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(intent);
}

Expand Down

0 comments on commit 6419323

Please sign in to comment.