Skip to content

Commit 8f8382d

Browse files
committed
detach view in onPause of fragments
1 parent 7369426 commit 8f8382d

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

raveandroid/src/main/java/com/flutterwave/raveandroid/account/AccountFragment.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,14 @@ public void onDisplayInternetBankingPage(String authurl, String flwRef) {
397397
bottomSheetBehaviorInternetBanking.setState(BottomSheetBehavior.STATE_EXPANDED);
398398
}
399399

400+
@Override
401+
public void onPause() {
402+
super.onPause();
403+
if (presenter != null) {
404+
presenter.onDetachView();
405+
}
406+
}
407+
400408
@Override
401409
public void onChargeAccountFailed(String message, String responseAsJSONString) {
402410
showToast(message);

raveandroid/src/main/java/com/flutterwave/raveandroid/card/CardFragment.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,19 @@ public void onPaymentError(String message) {
415415
Toast.makeText(getActivity(), message, Toast.LENGTH_LONG).show();
416416
}
417417

418+
@Override
419+
public void onPause() {
420+
super.onPause();
421+
if (presenter != null) {
422+
presenter.onDetachView();
423+
}
424+
}
425+
426+
@Override
427+
public void onDestroy() {
428+
super.onDestroy();
429+
}
430+
418431
/**
419432
* Called when a pin suggested auth model is required.
420433
* It shows a dialog that receives the pin and sends the payment payload

0 commit comments

Comments
 (0)