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

resolve issue for activity launching multiple times #117

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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