From 04ea23b5f30b4b31e973a058e265448bf6276639 Mon Sep 17 00:00:00 2001 From: EGOR-IND <56648862+EGOR-IND@users.noreply.github.com> Date: Sun, 7 Mar 2021 20:55:43 +0530 Subject: [PATCH] resolve all multiple time activity launch issues --- .../customers/customerdetails/CustomerDetailsFragment.java | 7 +++++++ .../online/customers/customerlist/CustomersFragment.java | 2 ++ .../fineract/ui/online/dashboard/DashboardFragment.java | 1 + .../depositaccountslist/DepositAccountsFragment.java | 1 + .../ui/online/groups/groupdetails/GroupDetailsFragment.kt | 1 + .../ui/online/groups/grouplist/GroupListFragment.kt | 2 ++ .../identificationlist/IdentificationsFragment.java | 1 + .../loanaccounts/loanaccountlist/LoanAccountsFragment.java | 1 + .../loandetails/CustomerLoanDetailsFragment.java | 2 ++ 9 files changed, 18 insertions(+) diff --git a/app/src/main/java/org/apache/fineract/ui/online/customers/customerdetails/CustomerDetailsFragment.java b/app/src/main/java/org/apache/fineract/ui/online/customers/customerdetails/CustomerDetailsFragment.java index b34f58e1..d62d8e63 100644 --- a/app/src/main/java/org/apache/fineract/ui/online/customers/customerdetails/CustomerDetailsFragment.java +++ b/app/src/main/java/org/apache/fineract/ui/online/customers/customerdetails/CustomerDetailsFragment.java @@ -164,6 +164,7 @@ 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); } @@ -171,6 +172,7 @@ void viewDepositAccounts() { void viewLoanAccounts() { Intent intent = new Intent(getActivity(), LoanAccountsActivity.class); intent.putExtra(ConstantKeys.CUSTOMER_IDENTIFIER, customerIdentifier); + intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); startActivity(intent); } @@ -187,6 +189,7 @@ 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); } @@ -194,6 +197,7 @@ void showIdentificationCards() { void showCustomerProfileImage() { Intent intent = new Intent(getActivity(), CustomerProfileActivity.class); intent.putExtra(ConstantKeys.CUSTOMER_IDENTIFIER, customerIdentifier); + intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); startActivity(intent); } @@ -201,6 +205,7 @@ void showCustomerProfileImage() { void showCustomerActivities() { Intent intent = new Intent(getActivity(), CustomerActivitiesActivity.class); intent.putExtra(ConstantKeys.CUSTOMER_IDENTIFIER, customerIdentifier); + intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); startActivity(intent); } @@ -208,6 +213,7 @@ void showCustomerActivities() { void showPayrollActivity() { Intent intent = new Intent(getActivity(), PayrollActivity.class); intent.putExtra(ConstantKeys.CUSTOMER_IDENTIFIER, customerIdentifier); + intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); startActivity(intent); } @@ -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); } diff --git a/app/src/main/java/org/apache/fineract/ui/online/customers/customerlist/CustomersFragment.java b/app/src/main/java/org/apache/fineract/ui/online/customers/customerlist/CustomersFragment.java index b4d80d1f..7005c9ea 100644 --- a/app/src/main/java/org/apache/fineract/ui/online/customers/customerlist/CustomersFragment.java +++ b/app/src/main/java/org/apache/fineract/ui/online/customers/customerlist/CustomersFragment.java @@ -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); } @@ -321,6 +322,7 @@ 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); } diff --git a/app/src/main/java/org/apache/fineract/ui/online/dashboard/DashboardFragment.java b/app/src/main/java/org/apache/fineract/ui/online/dashboard/DashboardFragment.java index ff4f70dc..f7ae8d0d 100644 --- a/app/src/main/java/org/apache/fineract/ui/online/dashboard/DashboardFragment.java +++ b/app/src/main/java/org/apache/fineract/ui/online/dashboard/DashboardFragment.java @@ -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); } } diff --git a/app/src/main/java/org/apache/fineract/ui/online/depositaccounts/depositaccountslist/DepositAccountsFragment.java b/app/src/main/java/org/apache/fineract/ui/online/depositaccounts/depositaccountslist/DepositAccountsFragment.java index 8b00da49..bd1823f7 100644 --- a/app/src/main/java/org/apache/fineract/ui/online/depositaccounts/depositaccountslist/DepositAccountsFragment.java +++ b/app/src/main/java/org/apache/fineract/ui/online/depositaccounts/depositaccountslist/DepositAccountsFragment.java @@ -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); } diff --git a/app/src/main/java/org/apache/fineract/ui/online/groups/groupdetails/GroupDetailsFragment.kt b/app/src/main/java/org/apache/fineract/ui/online/groups/groupdetails/GroupDetailsFragment.kt index 7095ac0f..ed61ea8a 100644 --- a/app/src/main/java/org/apache/fineract/ui/online/groups/groupdetails/GroupDetailsFragment.kt +++ b/app/src/main/java/org/apache/fineract/ui/online/groups/groupdetails/GroupDetailsFragment.kt @@ -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) } diff --git a/app/src/main/java/org/apache/fineract/ui/online/groups/grouplist/GroupListFragment.kt b/app/src/main/java/org/apache/fineract/ui/online/groups/grouplist/GroupListFragment.kt index 448554b6..909388ac 100644 --- a/app/src/main/java/org/apache/fineract/ui/online/groups/grouplist/GroupListFragment.kt +++ b/app/src/main/java/org/apache/fineract/ui/online/groups/grouplist/GroupListFragment.kt @@ -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) } @@ -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) } diff --git a/app/src/main/java/org/apache/fineract/ui/online/identification/identificationlist/IdentificationsFragment.java b/app/src/main/java/org/apache/fineract/ui/online/identification/identificationlist/IdentificationsFragment.java index 733b6883..4a055778 100644 --- a/app/src/main/java/org/apache/fineract/ui/online/identification/identificationlist/IdentificationsFragment.java +++ b/app/src/main/java/org/apache/fineract/ui/online/identification/identificationlist/IdentificationsFragment.java @@ -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); } diff --git a/app/src/main/java/org/apache/fineract/ui/online/loanaccounts/loanaccountlist/LoanAccountsFragment.java b/app/src/main/java/org/apache/fineract/ui/online/loanaccounts/loanaccountlist/LoanAccountsFragment.java index 7862fca1..c0e57023 100644 --- a/app/src/main/java/org/apache/fineract/ui/online/loanaccounts/loanaccountlist/LoanAccountsFragment.java +++ b/app/src/main/java/org/apache/fineract/ui/online/loanaccounts/loanaccountlist/LoanAccountsFragment.java @@ -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); } diff --git a/app/src/main/java/org/apache/fineract/ui/online/loanaccounts/loandetails/CustomerLoanDetailsFragment.java b/app/src/main/java/org/apache/fineract/ui/online/loanaccounts/loandetails/CustomerLoanDetailsFragment.java index 51cbc3bf..751990a9 100644 --- a/app/src/main/java/org/apache/fineract/ui/online/loanaccounts/loandetails/CustomerLoanDetailsFragment.java +++ b/app/src/main/java/org/apache/fineract/ui/online/loanaccounts/loandetails/CustomerLoanDetailsFragment.java @@ -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); } @@ -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); }