title: how to set the starting tab in tab layout with Toolbar?
body: <p>I'm sorry I am not fluent in English.
  I wanna change the starting fragment in tab layout.
  There is a value from another activity that gave with intent.
  so I just want to start tab layout's fragment with my selection.</p>
  
  <p>This is main activity's <code>onCreate()</code></p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
      private SectionsPagerAdapter mSectionsPagerAdapter;
      private ViewPager mViewPager;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
          setSupportActionBar(toolbar);
          // Create the adapter that will return a fragment for each of the three
          // primary sections of the activity.
          mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
          // Set up the ViewPager with the sections adapter.
          mViewPager = (ViewPager) findViewById(R.id.container);
          mViewPager.setAdapter(mSectionsPagerAdapter);
  
          TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
          tabLayout.setupWithViewPager(mViewPager);
  
      }
  </code></pre>
  
  <p>And this is the code of changing in fragment</p>
  
  <pre><code>    public class SectionsPagerAdapter extends FragmentPagerAdapter {
  
          public SectionsPagerAdapter(FragmentManager fm) {
                  super(fm);
  
          }
  
          @Override
          public Fragment getItem(int position) {
              switch(position)
              {
                  case 0:
                      return new TotalFragment();
                  case 1:
                      return new StatsFragment();
                  case 2:
                      return new FeedbackFragment();
                  case 3:
                      return new ManageFragment();
              }
              return null;
          }
  
          @Override
          public int getCount() {
              return 4;
          }
  
          @Override
          public CharSequence getPageTitle(int position) {
              switch (position) {
                  case 0:
                      return "TOTAL";
                  case 1:
                      return "STATS";
                  case 2:
                      return "FEEDBACK";
                  case 3:
                      return "MANAGE";
              }
              return null;
          }
      }
  }
  </code></pre>