title: maintain custom marker info window on configuration change
body: <h2>Question</h2>
  <p>Why does my custom <code>infowindow</code> not 'inflate' after a configuration change?</p>
  <h2>Summary</h2>
  <p>I have an app that places a marker on a map using <code>MarkerManager</code>, and sets a custom info-window using <code>setInfoWindowAdapter</code>.</p>
  <p>After loading the app and clicking on the marker, the info-window correctly displays my custom layout.</p>
  <p>However, after rotating the app so that the configuration changes, selecting the marker no longer displays the custom info-window, and instead only displays the generic 'title'.</p>
  <p>What have I missed in all the hours of reading and tutorials that means I'm not correctly implementing this?</p>
  <h2>Code</h2>
  <p>Here is a stripped-down version of my app to replicate the issue</p>
  <p><strong>MapsActivity</strong></p>
  <pre><code>public class MapsActivity extends FragmentActivity implements OnMapReadyCallback {
  
      private GoogleMap mMap;
      MarkerManager.Collection mMarkerManagerCollection;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_maps);
  
          SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
                  .findFragmentById(R.id.map);
          mapFragment.getMapAsync(this);
  
          if(savedInstanceState == null){
              mapFragment.setRetainInstance(true);   // maintains the map fragment on orientation changes
          }
      }
  
      @Override
      public void onMapReady(GoogleMap googleMap) {
          mMap = googleMap;
          MarkerManager mMarkerManager = new MarkerManager(mMap);
  
          mMap.setInfoWindowAdapter(mMarkerManager);
  
          mMarkerManagerCollection = mMarkerManager.newCollection(&quot;myMarker&quot;);
          mMarkerManagerCollection.setOnInfoWindowAdapter(new GoogleMap.InfoWindowAdapter(){
  
              @Override
              public View getInfoWindow(Marker marker) {
                  return null;
              }
  
              @Override
              public View getInfoContents(Marker marker) {
                  View v = getLayoutInflater().inflate(R.layout.info_window, null);
  
                  TextView tv = (TextView) v.findViewById(R.id.myTv);
                  tv.setText(&quot;hello world, this is my marker&quot;);
                  return v;
              }
          });
  
  
          // Add a marker in Sydney and move the camera
          LatLng sydney = new LatLng(-34, 151);
  
          MarkerOptions options = new MarkerOptions()
                  .position(sydney)
                  .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED))
                  .flat(true)
                  .title(&quot;Marker in Sydney&quot;);
  
          Marker marker = mMarkerManagerCollection.addMarker(options);
          marker.setTag(&quot;test marker&quot;);
          mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));
      }
  }
  </code></pre>
  <p><strong>info_window.xml</strong></p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      android:orientation=&quot;horizontal&quot;
      android:layout_width=&quot;wrap_content&quot;
      android:layout_height=&quot;wrap_content&quot;&gt;
  
      &lt;LinearLayout
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:orientation=&quot;horizontal&quot;&gt;
  
          &lt;ImageView
              android:layout_width=&quot;93dp&quot;
              android:layout_height=&quot;96dp&quot;
              android:id=&quot;@+id/rect_load&quot;
              android:padding=&quot;2dp&quot;
              android:src=&quot;@mipmap/ic_launcher&quot;
              /&gt;
  
          &lt;LinearLayout
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:orientation=&quot;vertical&quot;&gt;
  
  
              &lt;TextView
                  android:id=&quot;@+id/myTv&quot;
                  android:layout_width=&quot;wrap_content&quot;
                  android:layout_height=&quot;wrap_content&quot;
                  android:text=&quot;myText&quot;/&gt;
  
          &lt;/LinearLayout&gt;
          
      &lt;/LinearLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  <p><strong>Gradle</strong></p>
  <pre><code>compile 'com.android.support:appcompat-v7:25.0.0'
  compile 'com.google.android.gms:play-services:9.8.0'
  compile 'com.google.maps.android:android-maps-utils:0.4'
  compile 'com.google.android.gms:play-services:9.8.0'
  </code></pre>