I just want to set "Tab1" as default tab in this app and for that i set true in this piece of code ' 
  tabLayout.addTab(tabLayout.newTab().setText("Tab1"), true);but, this is not working. 
public class MainActivity extends AppCompatActivity implements TabLayout.OnTabSelectedListener {
    Toolbar toolbar;
    Fragment fragment;
    TabLayout tabLayout;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        tabLayout = findViewById(R.id.tablayout);
        toolbar = findViewById(R.id.toolbar);
        toolbar.setTitle("lalit kumar");
        setSupportActionBar(toolbar);
        tabLayout.addTab(tabLayout.newTab().setText("Tab1"), true);
        tabLayout.addTab(tabLayout.newTab().setText("Tab2"));
        tabLayout.addTab(tabLayout.newTab().setText("Tab3"));
        tabLayout.addOnTabSelectedListener(this);
    }
    @Override
    public void onTabSelected(TabLayout.Tab tab) {
        fragmentimplement(tab.getPosition());
    }
    @Override
    public void onTabUnselected(TabLayout.Tab tab) {
    }
    @Override
    public void onTabReselected(TabLayout.Tab tab) {
    }
    public void fragmentimplement(int position) {
        switch (position) {
            case 0:
                fragment = new AFragment();
                break;
            case 1:
                fragment = new BFragment();
                break;
            case 2:
                fragment = new CFragment();
                break;
        }
        getSupportFragmentManager().beginTransaction().replace(R.id.frame, fragment).commit();
    }
}
 
     
    