title: Android google maps loads on first open then crashes on 2nd open
body: <p>I have implemented a google map in my android project in a fragment. When I load the fragment the first time it calls an async tasks and loads the markers and displays correctley. </p>
  
  <p>But if I move to another fragment and then come back to the map it crashes once it tries to load again.</p>
  
  <p>My error is:</p>
  
  <pre><code>android.view.InflateException: Binary XML file line #4: Error inflating class fragment
         at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java)
         at android.view.LayoutInflater.inflate(LayoutInflater.java)
         at android.view.LayoutInflater.inflate(LayoutInflater.java)
         at com.beerportfolio.beerportfoliopro.BreweryMap.onCreateView(BreweryMap.java:28)
         at android.support.v4.app.Fragment.performCreateView(Fragment.java:1500)
         at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:938)
         at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1115)
         at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
         at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1478)
         at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:446)
         at android.os.Handler.handleCallback(Handler.java)
         at android.os.Handler.dispatchMessage(Handler.java)
         at android.os.Looper.loop(Looper.java)
         at android.app.ActivityThread.main(ActivityThread.java)
         at java.lang.reflect.Method.invokeNative(Method.java)
         at java.lang.reflect.Method.invoke(Method.java)
         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java)
         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)
         at dalvik.system.NativeStart.main(NativeStart.java)
  Caused by: java.lang.IllegalArgumentException: Binary XML file line #4: Duplicate id 0x7f09003f, tag null, or parent id 0x0 with another fragment for com.google.android.gms.maps.SupportMapFragment
         at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:296)
         at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java)
         at android.view.LayoutInflater.inflate(LayoutInflater.java)
         at android.view.LayoutInflater.inflate(LayoutInflater.java)
         at com.beerportfolio.beerportfoliopro.BreweryMap.onCreateView(BreweryMap.java:28)
         at android.support.v4.app.Fragment.performCreateView(Fragment.java:1500)
         at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:938)
         at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1115)
         at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
         at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1478)
         at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:446)
         at android.os.Handler.handleCallback(Handler.java)
         at android.os.Handler.dispatchMessage(Handler.java)
         at android.os.Looper.loop(Looper.java)
         at android.app.ActivityThread.main(ActivityThread.java)
         at java.lang.reflect.Method.invokeNative(Method.java)
         at java.lang.reflect.Method.invoke(Method.java)
         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java)
         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)
         at dalvik.system.NativeStart.main(NativeStart.java)
  </code></pre>
  
  <p>In the error it says something about a duplicate so I assumed it was having trouble re-loading the map markers, so I tried to place a clear markers at the start but that doesn't fix it.</p>
  
  <p>My code for my map is:</p>
  
  <pre><code>public class BreweryMap extends Fragment {
  
      public BreweryMap(){}
  
      String beerId = "";
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
  
          View rootView = inflater.inflate(R.layout.activity_brewmap, container, false);
          setHasOptionsMenu(true);
  
          //get user information
          SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
          String userName = prefs.getString("userName", null);
          String userID = prefs.getString("userID", null);
  
  
          GoogleMap mMap;
          mMap = ((SupportMapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
  
          mMap.clear();
  
          //add url
          String url = "myURL";
  
          //call async to get breweries to add to
          new GetVisitedBreweries(getActivity(), mMap).execute(url);
  
  
          return rootView;
      }
  </code></pre>
  
  <p>The async tasks gets JSON parses the information and loads the map markers onto the map.</p>