QR settlement added crash handling
This commit is contained in:
parent
c46b8793a1
commit
7d8f9f5af2
@ -146,6 +146,7 @@ public class QRSettlementTransactionFragment extends DataBindingFragment impleme
|
||||
count = 0;
|
||||
totalAmount = 0;
|
||||
|
||||
try {
|
||||
for (PayDetail payDetail : payDetailList) {
|
||||
// Filter for QR transactions only
|
||||
if ((payDetail.getTransactionType() == TransactionsType.MMQR.value
|
||||
@ -163,6 +164,13 @@ public class QRSettlementTransactionFragment extends DataBindingFragment impleme
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (IllegalStateException e) {
|
||||
// Handle cursor window size exceeded error
|
||||
android.util.Log.e("QRSettlement", "Database cursor error - likely due to large data size", e);
|
||||
showEmptyDataView();
|
||||
settlementViewModel.isNoData.setValue(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (qrTransactionsList.isEmpty()) {
|
||||
showEmptyDataView();
|
||||
@ -175,8 +183,6 @@ public class QRSettlementTransactionFragment extends DataBindingFragment impleme
|
||||
setupSettlementDisplayData();
|
||||
}
|
||||
|
||||
// setupSettlementDisplayData();
|
||||
|
||||
} else {
|
||||
showEmptyDataView();
|
||||
settlementViewModel.isNoData.setValue(true);
|
||||
@ -191,6 +197,7 @@ public class QRSettlementTransactionFragment extends DataBindingFragment impleme
|
||||
count = 0;
|
||||
totalAmount = 0;
|
||||
|
||||
try {
|
||||
for (PayDetail payDetail : payDetailList) {
|
||||
// Filter for QR transactions only
|
||||
if ((payDetail.getTransactionType() == TransactionsType.MMQR.value
|
||||
@ -208,6 +215,13 @@ public class QRSettlementTransactionFragment extends DataBindingFragment impleme
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (IllegalStateException e) {
|
||||
// Handle cursor window size exceeded error
|
||||
android.util.Log.e("QRSettlement", "Database cursor error in last settlement - likely due to large data size", e);
|
||||
showEmptyDataView();
|
||||
settlementViewModel.isNoData.setValue(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (qrTransactionsList.isEmpty()) {
|
||||
showEmptyDataView();
|
||||
@ -217,8 +231,6 @@ public class QRSettlementTransactionFragment extends DataBindingFragment impleme
|
||||
settlementViewModel.isNoData.setValue(false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
showEmptyDataView();
|
||||
settlementViewModel.isNoData.setValue(true);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user