title: Android Google Maps v2. getMapAsync() does not run in a separate thread?
body: <p>Is getMapAsync() meant to run on a separate thread? I ask because on my application, when the map loads it appears to do it on the main thread because all UI is unresponsive until it loads. I am doing something wrong? Or am I meant to setup the background task myself?</p>
  
  <p>The code below is my SupportMapFragment sub class. I pass a reference of the callback (onMapReadyCallback) which is implemented in my main activity to this class.</p>
  
  <pre><code>public class Map extends SupportMapFragment
  {
  
      private OnMapReadyCallback callback;
  
      public static SupportMapFragment newInstance(OnMapReadyCallback callback)
      {
  
          Map map = new Map();
          map.callback = callback;
          return map;
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
      {
          return super.onCreateView(inflater, container, savedInstanceState);
      }
  
      @Override
      public void onActivityCreated(Bundle savedInstanceState)
      {
          super.onActivityCreated(savedInstanceState);
          getMapAsync(callback);
      }
  
      @Override
      public void getMapAsync(OnMapReadyCallback callback)
      {
          super.getMapAsync(callback);
      }
  </code></pre>
  
  <p>And in my main activity, the map fragment is added. </p>
  
  <pre><code>FragmentManager fragmentManager = this.getSupportFragmentManager();
              fragmentManager.beginTransaction().replace(R.id.map,Map.newInstance(this),Map.class.getName()).commit();
  </code></pre>