title: How to not reload Google Maps everytime I switch to a fragment
body: <p>I have a basic layout with a FragmentLayout inside it. I also have a navigation drawer and I change the contents of the FragmentLayout when different elements of the drawer are clicked, like so:</p>
  
  <pre><code>FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
  fragmentTransaction.replace(R.id.fragment_container, new WhateverFragment());
  fragmentTransaction.commit();
  </code></pre>
  
  <p>One of the fragments I'm using has a MapView in it. I initialize the mapView on its onCreateView function, like this:</p>
  
  <pre><code>@Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
  
          View v = inflater.inflate(R.layout.fragment_map, container, false);
          mapView = (MapView) v.findViewById(R.id.map);
          mapView.onCreate(savedInstanceState);
          mapView.onResume();//needed to get the map to display immediately
          MapsInitializer.initialize(this.getActivity());
          mapView.getMapAsync(this);
  
          return v;
      }
  </code></pre>
  
  <p>But this function gets called everytime I switch to this fragment, so the map gets reset and reloaded everytime (and thus not keeping markers or anything).</p>
  
  <p>Where should I put this mapView initialization code so that it is not called everytime?</p>