title: switching to another tab more than once gives EEROR
body: <p>i have a tabbed activity.
  When i switch from tab1 to tab2 or 3,the app runs smooth.
  Again i switch to tab1 and then switch to any other tab,the app crashes.</p>
  
  <h2>Tabbed activity java code</h2>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
      ViewPager vp;
      TabLayout tab;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          vp= (ViewPager) findViewById(R.id.viewpager);
          tab= (TabLayout) findViewById(R.id.tab);
          vp.setAdapter(new CustomAdapter(getSupportFragmentManager(),MainActivity.this));
          tab.setupWithViewPager(vp);
          tab.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
              @Override
              public void onTabSelected(TabLayout.Tab tab) {
  
                  vp.setCurrentItem(tab.getPosition());
              }
  
              @Override
              public void onTabUnselected(TabLayout.Tab tab) {
  
              }
  
              @Override
              public void onTabReselected(TabLayout.Tab tab) {
  
              }
          });
      }
      private class CustomAdapter extends FragmentPagerAdapter
      {
          private String fragments[]={"District","NearBy","Search"};
          public CustomAdapter(FragmentManager supportFragmentManager, Context applicationContext)
          {
              super(supportFragmentManager);
          }
  
          @Override
          public Fragment getItem(int position)
          {
              switch (position)
              {
                  case 0:
                      return new MqmDList();
                  case 1:
                      return new MqmLList();
                  case 2:
                      return new Mqm_MList();
                  default:
                      return null;
              }
          }
  
          @Override
          public int getCount() {
              return fragments.length;
          }
  
          @Override
          public CharSequence getPageTitle(int position) {
              return fragments[position];
          }
      }
      @Override
      public boolean onKeyDown(int keyCode, KeyEvent event)  {
          if (keyCode == KeyEvent.KEYCODE_BACK
                  &amp;&amp; event.getRepeatCount() == 0) {
              Intent homeIntent = new Intent(Intent.ACTION_MAIN);
              homeIntent.addCategory( Intent.CATEGORY_HOME );
              homeIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
              startActivity(homeIntent);
          }
          return super.onKeyDown(keyCode, event);
      }
  }
  </code></pre>
  
  <h2>Error</h2>
  
  <pre><code>05-06 12:37:38.380 3356-3356/soft.yu.com.maqam E/Google Maps Android API: Google Maps Android API v2 only supports devices with OpenGL ES 2.0 and above
  05-06 12:37:40.451 3356-3560/soft.yu.com.maqam E/DynamiteModule: Failed to load module descriptor class: Didn't find class "com.google.android.gms.dynamite.descriptors.com.google.android.gms.googlecertificates.ModuleDescriptor" on path: DexPathList[[zip file "/data/app/soft.yu.com.maqam-1/base.apk"],nativeLibraryDirectories=[/data/app/soft.yu.com.maqam-1/lib/x86, /system/lib, /vendor/lib]]
  05-06 12:37:48.548 3356-3356/soft.yu.com.maqam E/AndroidRuntime: FATAL EXCEPTION: main
                                                                   Process: soft.yu.com.maqam, PID: 3356
                                                                   android.view.InflateException: Binary XML file line #5: Binary XML file line #5: Error inflating class fragment
                                                                   Caused by: android.view.InflateException: Binary XML file line #5: Error inflating class fragment
                                                                   Caused by: java.lang.IllegalArgumentException: Binary XML file line #5: Duplicate id 0x7f0d0081, tag null, or parent id 0xffffffff with another fragment for com.google.android.gms.maps.SupportMapFragment
                                                                       at android.support.v4.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2293)
                                                                       at android.support.v4.view.LayoutInflaterCompatHC$FactoryWrapperHC.onCreateView(LayoutInflaterCompatHC.java:44)
                                                                       at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:189)
                                                                       at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:769)
                                                                       at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
                                                                       at android.view.LayoutInflater.rInflate(LayoutInflater.java:858)
                                                                       at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
                                                                       at android.view.LayoutInflater.inflate(LayoutInflater.java:518)
                                                                       at android.view.LayoutInflater.inflate(LayoutInflater.java:426)
                                                                       at soft.yu.com.maqam.Mqm_MList.onCreateView(Mqm_MList.java:67)
                                                                       at android.support.v4.app.Fragment.performCreateView(Fragment.java:1974)
                                                                       at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067)
                                                                       at android.support.v4.app.FragmentManagerImpl.attachFragment(FragmentManager.java:1430)
                                                                       at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:732)
                                                                       at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1617)
                                                                       at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:570)
                                                                       at android.support.v4.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:141)
                                                                       at android.support.v4.view.ViewPager.populate(ViewPager.java:1177)
                                                                       at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:608)
                                                                       at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:570)
                                                                       at android.support.v4.view.ViewPager.setCurrentItem(ViewPager.java:551)
                                                                       at soft.yu.com.maqam.MainActivity$1.onTabSelected(MainActivity.java:29)
                                                                       at android.support.design.widget.TabLayout.selectTab(TabLayout.java:1025)
                                                                       at android.support.design.widget.TabLayout.selectTab(TabLayout.java:995)
                                                                       at android.support.design.widget.TabLayout$Tab.select(TabLayout.java:1272)
                                                                       at android.support.design.widget.TabLayout$TabView.performClick(TabLayout.java:1377)
                                                                       at android.view.View$PerformClick.run(View.java:22215)
                                                                       at android.os.Handler.handleCallback(Handler.java:739)
                                                                       at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                       at android.os.Looper.loop(Looper.java:148)
                                                                       at android.app.ActivityThread.main(ActivityThread.java:6066)
                                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:770)
                                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:660)
  05-06 12:39:06.671 4725-4725/soft.yu.com.maqam E/Google Maps Android API: Google Maps Android API v2 only supports devices with OpenGL ES 2.0 and above
  05-06 12:39:08.120 4725-4725/soft.yu.com.maqam E/SurfaceTexture: isProtectedSurface: invalid current EGLDisplay
  
                                                                   [ 05-06 12:39:08.122  4725: 4826 D/         ]
                                                                   HostConnection::get() New Host Connection established 0xa9457af0, tid 4826
  05-06 12:39:08.736 4725-4828/soft.yu.com.maqam E/DynamiteModule: Failed to load module descriptor class: Didn't find class "com.google.android.gms.dynamite.descriptors.com.google.android.gms.googlecertificates.ModuleDescriptor" on path: DexPathList[[zip file "/data/app/soft.yu.com.maqam-1/base.apk"],nativeLibraryDirectories=[/data/app/soft.yu.com.maqam-1/lib/x86, /system/lib, /vendor/lib]]
  05-06 12:39:11.825 4725-4725/soft.yu.com.maqam E/AndroidRuntime: FATAL EXCEPTION: main
                                                                   Process: soft.yu.com.maqam, PID: 4725
                                                                   android.view.InflateException: Binary XML file line #5: Binary XML file line #5: Error inflating class fragment
                                                                   Caused by: android.view.InflateException: Binary XML file line #5: Error inflating class fragment
                                                                   Caused by: java.lang.IllegalArgumentException: Binary XML file line #5: Duplicate id 0x7f0d0081, tag null, or parent id 0xffffffff with another fragment for com.google.android.gms.maps.SupportMapFragment
                                                                       at android.support.v4.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2293)
                                                                       at android.support.v4.view.LayoutInflaterCompatHC$FactoryWrapperHC.onCreateView(LayoutInflaterCompatHC.java:44)
                                                                       at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:189)
                                                                       at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:769)
                                                                       at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
                                                                       at android.view.LayoutInflater.rInflate(LayoutInflater.java:858)
                                                                       at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
                                                                       at android.view.LayoutInflater.inflate(LayoutInflater.java:518)
                                                                       at android.view.LayoutInflater.inflate(LayoutInflater.java:426)
                                                                       at soft.yu.com.maqam.Mqm_MList.onCreateView(Mqm_MList.java:67)
                                                                       at android.support.v4.app.Fragment.performCreateView(Fragment.java:1974)
                                                                       at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067)
                                                                       at android.support.v4.app.FragmentManagerImpl.attachFragment(FragmentManager.java:1430)
                                                                       at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:732)
                                                                       at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1617)
                                                                       at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:570)
                                                                       at android.support.v4.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:141)
                                                                       at android.support.v4.view.ViewPager.populate(ViewPager.java:1177)
                                                                       at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:608)
                                                                       at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:570)
                                                                       at android.support.v4.view.ViewPager.setCurrentItem(ViewPager.java:551)
                                                                       at soft.yu.com.maqam.MainActivity$1.onTabSelected(MainActivity.java:29)
                                                                       at android.support.design.widget.TabLayout.selectTab(TabLayout.java:1025)
                                                                       at android.support.design.widget.TabLayout.selectTab(TabLayout.java:995)
                                                                       at android.support.design.widget.TabLayout$Tab.select(TabLayout.java:1272)
                                                                       at android.support.design.widget.TabLayout$TabView.performClick(TabLayout.java:1377)
                                                                       at android.view.View$PerformClick.run(View.java:22215)
                                                                       at android.os.Handler.handleCallback(Handler.java:739)
                                                                       at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                       at android.os.Looper.loop(Looper.java:148)
                                                                       at android.app.ActivityThread.main(ActivityThread.java:6066)
                                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:770)
                                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:660)
  05-06 12:39:20.267 4948-4948/soft.yu.com.maqam E/Google Maps Android API: Google Maps Android API v2 only supports devices with OpenGL ES 2.0 and above
  05-06 12:39:20.388 4948-4948/soft.yu.com.maqam E/SurfaceTexture: isProtectedSurface: invalid current EGLDisplay
  
                                                                   [ 05-06 12:39:20.388  4948: 5066 D/         ]
                                                                   HostConnection::get() New Host Connection established 0xab02c370, tid 5066
  05-06 12:39:22.332 4948-5070/soft.yu.com.maqam E/DynamiteModule: Failed to load module descriptor class: Didn't find class "com.google.android.gms.dynamite.descriptors.com.google.android.gms.googlecertificates.ModuleDescriptor" on path: DexPathList[[zip file "/data/app/soft.yu.com.maqam-1/base.apk"],nativeLibraryDirectories=[/data/app/soft.yu.com.maqam-1/lib/x86, /system/lib, /vendor/lib]]
  05-06 12:39:25.434 4948-4948/soft.yu.com.maqam E/AndroidRuntime: FATAL EXCEPTION: main
                                                                   Process: soft.yu.com.maqam, PID: 4948
                                                                   android.view.InflateException: Binary XML file line #5: Binary XML file line #5: Error inflating class fragment
                                                                   Caused by: android.view.InflateException: Binary XML file line #5: Error inflating class fragment
                                                                   Caused by: java.lang.IllegalArgumentException: Binary XML file line #5: Duplicate id 0x7f0d0081, tag null, or parent id 0xffffffff with another fragment for com.google.android.gms.maps.SupportMapFragment
                                                                       at android.support.v4.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2293)
                                                                       at android.support.v4.view.LayoutInflaterCompatHC$FactoryWrapperHC.onCreateView(LayoutInflaterCompatHC.java:44)
                                                                       at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:189)
                                                                       at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:769)
                                                                       at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
                                                                       at android.view.LayoutInflater.rInflate(LayoutInflater.java:858)
                                                                       at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
                                                                       at android.view.LayoutInflater.inflate(LayoutInflater.java:518)
                                                                       at android.view.LayoutInflater.inflate(LayoutInflater.java:426)
                                                                       at soft.yu.com.maqam.Mqm_MList.onCreateView(Mqm_MList.java:67)
                                                                       at android.support.v4.app.Fragment.performCreateView(Fragment.java:1974)
                                                                       at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067)
                                                                       at android.support.v4.app.FragmentManagerImpl.attachFragment(FragmentManager.java:1430)
                                                                       at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:732)
                                                                       at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1617)
                                                                       at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:570)
                                                                       at android.support.v4.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:141)
                                                                       at android.support.v4.view.ViewPager.populate(ViewPager.java:1177)
                                                                       at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:608)
                                                                       at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:570)
                                                                       at android.support.v4.view.ViewPager.setCurrentItem(ViewPager.java:551)
                                                                       at soft.yu.com.maqam.MainActivity$1.onTabSelected(MainActivity.java:29)
                                                                       at android.support.design.widget.TabLayout.selectTab(TabLayout.java:1025)
                                                                       at android.support.design.widget.TabLayout.selectTab(TabLayout.java:995)
                                                                       at android.support.design.widget.TabLayout$Tab.select(TabLayout.java:1272)
                                                                       at android.support.design.widget.TabLayout$TabView.performClick(TabLayout.java:1377)
                                                                       at android.view.View$PerformClick.run(View.java:22215)
                                                                       at android.os.Handler.handleCallback(Handler.java:739)
                                                                       at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                       at android.os.Looper.loop(Looper.java:148)
                                                                       at android.app.ActivityThread.main(ActivityThread.java:6066)
                                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:770)
                                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:660)
  </code></pre>
  
  <p>i have a tabbed activity.
  When i switch from tab1 to tab2 or 3,the app runs smooth.
  Again i switch to tab1 and then switch to any other tab,the app crashes.
  i have a tabbed activity.</p>
  
  <p>When i switch from tab1 to tab2 or 3,the app runs smooth.
  Again i switch to tab1 and then switch to any other tab,the app crashes.</p>