title: How to remove tab in tablayout in my Activity?
body: <p>i have 3 tabs in my <code>TabLayout</code>, my question is,  for example, i want to delete or disable one or more particular Tab from <code>TabLayout</code> and <code>ViewPager</code>, is it possible to achieve, how can i do this?</p>
  
  <p><strong>MainActivity</strong></p>
  
  <pre><code>public class MainActivity extends AppCompatActivity implements TabLayout.OnTabSelectedListener{
  
  TabLayout tabLayout;
  public static ViewPager viewPager;
  DBController db;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
      setSupportActionBar(toolbar);
  
      tabLayout = (TabLayout) findViewById(R.id.tabLayout);
  
      tabLayout.removeViewAt(3);
  
      viewPager = (ViewPager) findViewById(R.id.pager);
  
  
      Pager adapter = new Pager(getSupportFragmentManager(), tabLayout.getTabCount());
  
      viewPager.setAdapter(adapter);
  
      tabLayout.setOnTabSelectedListener(this);
  
      viewPager.setAdapter(new SectionPagerAdapter(getSupportFragmentManager()));
      tabLayout.setupWithViewPager(viewPager);
  
  
  }
  
  @Override
  public void onTabSelected(TabLayout.Tab tab) {
      viewPager.setCurrentItem(tab.getPosition());
  }
  
  @Override
  public void onTabUnselected(TabLayout.Tab tab) {
  
  }
  
  @Override
  public void onTabReselected(TabLayout.Tab tab) {
  
  }
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.main, menu);
      return true;
  
  }
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
  
      int id = item.getItemId();
  
      if (id == R.id.cartlist) {
          Intent intent = new Intent(this,cart_list.class);
          startActivity(intent);
          return true;
      }
          return true;
  }
  public class SectionPagerAdapter extends FragmentPagerAdapter {
  
      public SectionPagerAdapter(FragmentManager fm) {
          super(fm);
  
      }
  
      @Override
      public Fragment getItem(int position) {
          switch (position) {
                  case 0:
                      return new Tab1();
                  case 1:
                       return new Tab2();
                  case 2:
                      return new Tab4();
              }
          return  null;
      }
  
      @Override
      public int getCount() {
          return 3;
      }
  
      @Override
      public CharSequence getPageTitle(int position) {
          switch (position) {
              case 0:
                  return "ALL";
              case 1:
                  return "WESTERN";
              case 2:
                  return "-";
          }
          return null;
      }
  }
  </code></pre>