Fix memory leak in payments home.

main
Varsha 2022-11-14 15:06:49 -08:00 zatwierdzone przez Alex Hart
rodzic a4494b58f0
commit d5b6c47670
1 zmienionych plików z 1 dodań i 9 usunięć

Wyświetl plik

@ -55,8 +55,6 @@ public class PaymentsHomeFragment extends LoggingFragment {
private PaymentsHomeViewModel viewModel; private PaymentsHomeViewModel viewModel;
private final OnBackPressed onBackPressed = new OnBackPressed();
public PaymentsHomeFragment() { public PaymentsHomeFragment() {
super(R.layout.payments_home_fragment); super(R.layout.payments_home_fragment);
} }
@ -270,7 +268,7 @@ public class PaymentsHomeFragment extends LoggingFragment {
} }
}); });
requireActivity().getOnBackPressedDispatcher().addCallback(onBackPressed); requireActivity().getOnBackPressedDispatcher().addCallback(getViewLifecycleOwner(), new OnBackPressed());
} }
@Override @Override
@ -279,12 +277,6 @@ public class PaymentsHomeFragment extends LoggingFragment {
viewModel.checkPaymentActivationState(); viewModel.checkPaymentActivationState();
} }
@Override
public void onDestroyView() {
super.onDestroyView();
onBackPressed.setEnabled(false);
}
private void showUpdateIsRequiredDialog() { private void showUpdateIsRequiredDialog() {
new MaterialAlertDialogBuilder(requireContext()) new MaterialAlertDialogBuilder(requireContext())
.setTitle(getString(R.string.PaymentsHomeFragment__update_required)) .setTitle(getString(R.string.PaymentsHomeFragment__update_required))