title: Select third page as default in TabLayout + ViewPager2
body: <p>I'm trying to make third tab as default, but below piece of code does not work:</p>
  
  <pre><code>public class MessagesFragment extends Fragment {
  
      private FragmentsAdapter fragmentsAdapter;
      private ViewPager2 viewPager;
  
      @Override
      public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
          return inflater.inflate(R.layout.fragment_messages, container, false);
      }
  
      @Override
      public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
          fragmentsAdapter = new FragmentsAdapter(this);
          viewPager = view.findViewById(R.id.pager);
          viewPager.setAdapter(fragmentsAdapter);
          viewPager.setCurrentItem(2);
  
          TabLayout tabLayout = view.findViewById(R.id.tab_layout);
          TabLayoutMediator.TabConfigurationStrategy tabConfigurationStrategy = new TabLayoutMediator.TabConfigurationStrategy() {
              @Override
              public void onConfigureTab(@NonNull TabLayout.Tab tab, int position) {
                  switch (position) {
                      case FragmentsAdapter.MESSAGES_NEW:
                          tab.setText(R.string.navMessagesNew);
                          break;
                      case FragmentsAdapter.MESSAGES_READ:
                          tab.setText(R.string.navMessagesRead);
                          break;
                      case FragmentsAdapter.SETTINGS:
                          tab.setText(R.string.navSettings);
                          break;
                      default:
                          throw new IllegalArgumentException("There is no fragment for that position = " + position);
                  }
              }
          };
          new TabLayoutMediator(tabLayout, viewPager, tabConfigurationStrategy).attach();
      }
  }
  </code></pre>
  
  <p>I'm using TabLayout and ViewPager2. All the time 1st tab is default.
  Can anyone advise how to make a 3rd of my tab as default?
  Thanks</p>