Skip to content

Commit

Permalink
Merge pull request #11927 from wordpress-mobile/fix-fragment-lifecycl…
Browse files Browse the repository at this point in the history
…e-in-bottom-nav

Replace FragmentTransaction.show/hide with attach/detach - fix lifecycle
  • Loading branch information
planarvoid committed May 15, 2020
2 parents 45e46a4 + b41f81a commit 0f863e7
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ class WPMainNavigationView @JvmOverloads constructor(
val previousFragment = navAdapter.getFragment(prevPosition)
if (fragment != null) {
if (previousFragment != null) {
fragmentManager.beginTransaction().hide(previousFragment).show(fragment).commit()
fragmentManager.beginTransaction().detach(previousFragment).attach(fragment).commit()
} else {
fragmentManager.beginTransaction().show(fragment).commit()
fragmentManager.beginTransaction().attach(fragment).commit()
}
}
prevPosition = position
Expand Down

0 comments on commit 0f863e7

Please sign in to comment.