Prevent multiple finishes

pull/180/head
M66B 5 years ago
parent ac69307b0e
commit 4961b0d8f3

@ -67,6 +67,7 @@ public class FragmentBase extends Fragment {
private String title = null; private String title = null;
private String subtitle = " "; private String subtitle = " ";
private boolean finish = false; private boolean finish = false;
private boolean finished = false;
private long message = -1; private long message = -1;
private long attachment = -1; private long attachment = -1;
@ -117,6 +118,10 @@ public class FragmentBase extends Fragment {
} }
protected void finish() { protected void finish() {
if (finished)
return;
finished = true;
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
getParentFragmentManager().popBackStack(); getParentFragmentManager().popBackStack();
else else

Loading…
Cancel
Save