title: FragmentManager is already executing transactions on commitAllowingStateLoss()
body: <pre><code>java.lang.IllegalStateException: FragmentManager is already executing transactions
  </code></pre>
  
  <p>I've read all StackOverflow questions about that, and nothing helped.
  Just wanted to share my experience</p>
  
  <pre><code>public void onResume() {
      super.onResume()
  
      if(condition) replaceFragment()
  }
  
  public void replaceFragment() {
      if (fragmentName != null &amp;&amp; !this.isDestroyed()) {
          final FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
  
          ft.replace(container_id, FragmentInstantiate());
          ft.commitAllowingStateLoss();
      }
  }
  </code></pre>
  
  <p>it is commit()/commitAllowingStateLoss() that caused IllegalStateException: FragmentManager is already executing transactions. NOT commitNow() or executePendingTransactions()</p>