Skip to content

Commit

Permalink
fix Cannot setMaxLifecycle for Fragment not attached to FragmentManager
Browse files Browse the repository at this point in the history
  • Loading branch information
lwj1994 committed Apr 21, 2021
1 parent f0c861b commit 46f2db4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public void onAnimationRepeat(Animation animation) {
}

private void performPopBack(Fragment preFrag) {
if (preFrag != null) {
if (preFrag != null && !preFrag.isDetached()) {
mFragmentManager.beginTransaction().setMaxLifecycle(preFrag, Lifecycle.State.RESUMED).commit();
}
mFragmentManager.popBackStack(
Expand Down

0 comments on commit 46f2db4

Please sign in to comment.