title: Switching between fragments causes UI to block - How to load fragment using async?
body: <p>So I have an Activity with two fragments.</p>
  
  <p>One of the fragments is a map fragment and whenever I load it for the first time, there is a pretty significant delay and the UI is pretty much blocked. This is how I switch/start my fragments:</p>
  
  <pre><code>private void showMapFragment(){
      m_VenuesMapFragment = VenuesMapFragment.getInstance(getVenuesBundle());
      actionBar.setTitle(cat.getName() + " - Map");
      FragmentTransaction transaction = getFragmentManager().beginTransaction();
      transaction.replace(R.id.fragment_container, fragment);
      transaction.addToBackStack(null);
      transaction.commit();
  }
  </code></pre>
  
  <p>I have a loading animation in my Activity's layout whenever I switch from one fragment to another, but the loading animation simply blocks until the fragment is ready so there is really no point of showing it, unless I can animate it, which then depends on loading the fragment in a different thread.</p>
  
  <p><strong>Question:</strong></p>
  
  <p>Is there any way to load the fragment in a sort of async way and display a loading screen until the fragment is created without blocking the UI thread?</p>