title: Loading Android Google Map fragment managed by ViewPager
body: <p>I can load a google map into an Android fragment that's within an activity.  That has been working fine.</p>
  
  <p>But now I want to use ViewPager to navigate between views (class <strong><code>android.support.v4.app.Fragment</code></strong>).  It doesn't seem possible to load a <strong><code>com.google.android.gms.maps.MapFragment</code></strong> into such a fragment. </p>
  
  <p>For example, in:</p>
  
  <p><strong>SoleMap.java</strong></p>
  
  <pre><code>import android.os.Bundle;
  import android.support.v4.app.Fragment;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import com.google.android.gms.maps.CameraUpdateFactory;
  import com.google.android.gms.maps.GoogleMap;
  import com.google.android.gms.maps.MapFragment;
  import com.google.android.gms.maps.OnMapReadyCallback;
  import com.google.android.gms.maps.model.LatLng;
  
  public class SoleMap extends Fragment implements OnMapReadyCallback {
  
      MapFragment gMapFragment;
      GoogleMap gMap = null;
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
          View view = inflater.inflate(R.layout.sole_map, container, false);
  
          gMapFragment = (MapFragment) getFragmentManager().findFragmentById(R.id.soleViewMap);
          gMapFragment.getMapAsync(this);
  
          return view;
      }
  
      @Override
      public void onMapReady(GoogleMap map) {
          gMap = map;
          gMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);
          gMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new
                  LatLng(49.39,-124.83), 20));
      }
  
  }
  </code></pre>
  
  <p>The statement</p>
  
  <pre><code>getFragmentManager().findFragmentById(R.id.holeViewMap);
  </code></pre>
  
  <p>causes a compiler error (incompatible types).</p>
  
  <p>I have tried to use SupportMapFragment instead, which eliminates the compiler errors, but then when I run the app, it quits immediately with the message "I/O Error:  Connection refused."  The Google docs seem to indicate that you need a special "For Work" account to use the Support library.  Is that correct?  If so, I guess I'm out of luck.</p>
  
  <p>The only other way I can see to do it is to use activities instead of fragments to host my views, i.e., get rid of the <strong>ViewPager</strong>.</p>
  
  <p>Any suggestions?</p>