title: FragmentTransaction hide/show doesn't work sometimes
body: <p>I have an activity with bottom navigation tabs that are changing the fragments in it. When I click back and forth on those tabs, at some point it stops working. Code executes just fine as I put some logs in it. But the fragments aren't being switched. </p>
  
  <p>Code is in kotlin but it's rather straight forward</p>
  
  <pre><code>fun showTabFragment(tag: String) {
          val currentFragment: Fragment? = supportFragmentManager.fragments?.lastOrNull()
          var fragment = supportFragmentManager.findFragmentByTag(tag)
          val fragmentExists = fragment != null
          if (fragment == null) {
              when (tag) {
                  TAG_LOGBOOK -&gt; fragment = LogbookFragment()
                  TAG_RECIPES -&gt; fragment = RecipesFragment()
                  TAG_PROFILE -&gt; fragment = ProfileFragment()
                  else -&gt; fragment = MeetingPlacesFragment()
              }
          }
  
          val transaction = supportFragmentManager.beginTransaction()
  
          if (currentFragment != null) {
              Log.i("jacek", "hiding " + currentFragment.javaClass.simpleName)
              transaction.hide(currentFragment)
          }
  
          if (fragmentExists) {
              Log.i("jacek", "showing " + fragment.javaClass.simpleName)
              transaction.show(fragment)
          } else {
              Log.i("jacek", "adding " + fragment.javaClass.simpleName)
              transaction.add(R.id.container, fragment, tag)
          }
  
          transaction.commit()
      }
  </code></pre>
  
  <p>The fragments are quite heavy. I will try with some lightweight ones, but still that shouldn't be a problem in my opinion. Is there anything else I could try?</p>
  
  <p>I'm using the latest support library - 25.2.0
  Also I'm not interested in replacing the fragments as the point is to add crossfade animation without recreating them</p>