title: Missing tab name and tab names doesn't change on android studio
body: <p>I have my main acitivty which opens SearchActivity with tabs, I did 3 tabs I see only 2 when I run the app and the tab names dont change from Tab 1, Tab 2 to what I configured.</p>
  
  <p>public class MainActivity extends AppCompatActivity {</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      //Open search window
      Button button = findViewById(R.id.buttonSearch);
      button.setOnClickListener(new View.OnClickListener() {
          /**
           * Called when a view has been clicked.
           *
           * @param v The view that was clicked.
           */
          @Override
          public void onClick(View v) {
              openSearchActivity();
          }
      });
  }
  
  public void openSearchActivity() {
      Intent intent = new Intent(this, SearchActivity.class);
      startActivity(intent);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>public class SearchActivity extends AppCompatActivity {</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_search);
      SectionsPagerAdapter sectionsPagerAdapter = new SectionsPagerAdapter(this, getSupportFragmentManager());
      ViewPager viewPager = findViewById(R.id.view_pager);
      viewPager.setAdapter(sectionsPagerAdapter);
      TabLayout tabs = findViewById(R.id.tabs);
      tabs.setupWithViewPager(viewPager);
      FloatingActionButton fab = findViewById(R.id.fab);
  
      fab.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
              Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                      .setAction("Action", null).show();
          }
      });
  }
  
  public class SectctionPagerAdapter extends FragmentPagerAdapter {
      /**
       * Constructor for {@link FragmentPagerAdapter} that sets the fragment manager for the adapter.
       * This is the equivalent of calling {@link #( FragmentManager , int)} and
       * passing in {@link #BEHAVIOR_SET_USER_VISIBLE_HINT}.
       *
       * &lt;p&gt;Fragments will have {@link Fragment#setUserVisibleHint(boolean)} called whenever the
       * current Fragment changes.&lt;/p&gt;
       *
       * @param fm fragment manager that will interact with this adapter
       * @deprecated use {@link #(FragmentManager, int)} with
       * {@link #BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT}
       */
      public SectctionPagerAdapter(@NonNull FragmentManager fm) {
          super(fm);
      }
  
      /**
       * Return the Fragment associated with a specified position.
       *
       * @param position
       */
      @NonNull
      @Override
      public Fragment getItem(int position) {
          switch (position) {
              case 0:
                  return new BuildingTabOne();
              case 1:
                  return new BuildingTabTwo();
              case 2:
                  return new BuildingTabThree();
              default:
                  return null;
          }
      }
  
      public CharSequence getPageTitle(int position) {
          switch (position) {
              case 0:
                  return "T15";
              case 1:
                  return "Y3";
              case 2:
                  return "T21";
          }
          return null;
      }
  
      /**
       * Return the number of tabs available.
       */
      @Override
      public int getCount() {
          return 3;
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Example one tab:</p>
  
  <pre><code>public class BuildingTabTwo extends Fragment {
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          View view = inflater.inflate(R.layout.building_tab_two, container, false);
          return view;
      }
  }
  </code></pre>
  
  <p>what did I do wrong?</p>
  
  <p>Edit: added layout:
  Main:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;androidx.constraintlayout.widget.ConstraintLayout
          xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          xmlns:app="http://schemas.android.com/apk/res-auto"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          tools:context=".MainActivity"&gt;
      &lt;Button
              android:text="Search"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content" android:id="@+id/buttonSearch"
              app:layout_constraintBottom_toBottomOf="parent"
              app:layout_constraintTop_toTopOf="parent" app:layout_constraintVertical_bias="0.919"
              app:layout_constraintStart_toStartOf="parent" app:layout_constraintHorizontal_bias="0.5"
              app:layout_constraintEnd_toEndOf="parent"/&gt;
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  </code></pre>
  
  <p>Search:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;androidx.coordinatorlayout.widget.CoordinatorLayout
          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"
          tools:context=".SearchActivity"&gt;
  
      &lt;com.google.android.material.appbar.AppBarLayout
              android:layout_height="wrap_content"
              android:layout_width="match_parent"
              android:theme="@style/AppTheme.AppBarOverlay"&gt;
  
          &lt;TextView
                  android:id="@+id/title"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:gravity="center"
                  android:minHeight="?actionBarSize"
                  android:padding="@dimen/appbar_padding"
                  android:text="@string/app_name"
                  android:textAppearance="@style/TextAppearance.Widget.AppCompat.Toolbar.Title"/&gt;
  
          &lt;com.google.android.material.tabs.TabLayout
                  android:id="@+id/tabs"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:background="?attr/colorPrimary"/&gt;
      &lt;/com.google.android.material.appbar.AppBarLayout&gt;
  
      &lt;androidx.viewpager.widget.ViewPager
              android:id="@+id/view_pager"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              app:layout_behavior="@string/appbar_scrolling_view_behavior"/&gt;
  
      &lt;com.google.android.material.floatingactionbutton.FloatingActionButton
              android:id="@+id/fab"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="bottom|end"
              android:layout_margin="@dimen/fab_margin"
              app:srcCompat="@android:drawable/ic_dialog_email"/&gt;
  &lt;/androidx.coordinatorlayout.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p>Tab layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_width="match_parent"
                android:layout_height="match_parent"&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>