title: App crashes when opening Map Fragment twice
body: <p>I'm designing my app with backwards comptibility so I have implemented the support and design libraries to use things like navigation drawer and other effects asociated with new android versions.</p>
  
  <p>The navigation drawer manages a total of 5 fragments. One of these fragments contains a map:</p>
  
  <pre><code>&lt;RelativeLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;fragment
          android:id="@+id/map"
          android:layout_width="match_parent"
          android:layout_height="300dp"
          class="com.google.android.gms.maps.MapFragment" /&gt;
  </code></pre>
  
  <p>-</p>
  
  <pre><code>public class LocationFragment extends Fragment {
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          View rootView = inflater.inflate(R.layout.fragment_location, container, false);
  
          /*Try to obtain the map from the SupportMapFragment*/
          mMap = ((MapFragment) getActivity().getFragmentManager().findFragmentById(R.id.map)).getMap();
  </code></pre>
  
  <p>And this is how I manage the fragments from navigation drawer on mainActivity:</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity implements DrawerLayout.DrawerListener{
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
  
          navView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
          @Override public boolean onNavigationItemSelected(MenuItem menuItem) {
              menuItem.setChecked(true);
              displayFragment(menuItem.getItemId());
              drawerLayout.closeDrawers();
              return true;
          }
      });
  
  
  private void displayFragment(int itemId) {
      Fragment fragment = null;
      String title = getString(R.string.app_name);
      switch (itemId) {
          case R.id.navigation_item_1:
              fragment = new StatusFragment();
              title = getString(R.string.title_status);
              break;
          case R.id.navigation_item_2:
              fragment = new LocationFragment();
              title = getString(R.string.title_location);
              break;
          case R.id.navigation_item_3:
              fragment = new SetupFragment();
              title = getString(R.string.title_setup);
              break;
          case R.id.navigation_item_4:
              fragment = new ProfileFragment();
              title = getString(R.string.title_profile);
              break;
          case R.id.navigation_item_5:
              fragment = new AboutFragment();
              title = getString(R.string.title_about);
              break;
          default:
              break;
      }
  
      if (fragment != null) {
          FragmentManager fragmentManager = getSupportFragmentManager();
          FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
          fragmentTransaction.replace(R.id.container_body, fragment);
          fragmentTransaction.commit();
  
          /*set the toolbar title*/
          toolbar.setTitle(title);
      }
  }
  </code></pre>
  
  <p>The thing is that if I open this map fragment, it works fine, but if I then go to another fragment, and then come back to the map fragment, the app crashes showing this in the logcat:</p>
  
  <pre><code>android.view.InflateException: Binary XML file line #11: Error inflating class fragment
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:713)
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
          at com.masmr.detgprs.LocationFragment.onCreateView(LocationFragment.java:102)
          at android.support.v4.app.Fragment.performCreateView(Fragment.java:1789)
          at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:955)
          at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1138)
          at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:740)
          at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1501)
          at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:458)
          at android.os.Handler.handleCallback(Handler.java:733)
          at android.os.Handler.dispatchMessage(Handler.java:95)
          at android.os.Looper.loop(Looper.java:136)
          at android.app.ActivityThread.main(ActivityThread.java:5146)
          at java.lang.reflect.Method.invokeNative(Native Method)
          at java.lang.reflect.Method.invoke(Method.java:515)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:732)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:566)
          at dalvik.system.NativeStart.main(Native Method)
  
  Caused by: java.lang.IllegalArgumentException: Binary XML file line #11: Duplicate id 0x7f0c0090, tag null, or parent id 0xffffffff with another fragment for com.google.android.gms.maps.MapFragment
          at android.app.Activity.onCreateView(Activity.java:4791)
          at 
  
  android.support.v7.app.AppCompatDelegateImplV11.callActivityOnCreateView(AppCompatDelegateImplV11.java:41)
              at android.support.v7.app.AppCompatDelegateImplV7.onCreateView(AppCompatDelegateImplV7.java:826)
              at android.support.v4.view.LayoutInflaterCompatHC$FactoryWrapperHC.onCreateView(LayoutInflaterCompatHC.java:44)
              at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:172)
              at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:684)
              at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
              at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
              at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
              at com.masmr.detgprs.LocationFragment.onCreateView(LocationFragment.java:102)
              at android.support.v4.app.Fragment.performCreateView(Fragment.java:1789)
              at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:955)
              at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1138)
              at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:740)
              at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1501)
              at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:458)
              at android.os.Handler.handleCallback(Handler.java:733)
              at android.os.Handler.dispatchMessage(Handler.java:95)
              at android.os.Looper.loop(Looper.java:136)
              at android.app.ActivityThread.main(ActivityThread.java:5146)
              at java.lang.reflect.Method.invokeNative(Native Method)
              at java.lang.reflect.Method.invoke(Method.java:515)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:732)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:566)
              at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>The 102 line refers to map fragment's onCreateView()'s first line where I inflate the map_layout.</p>