title: Change the selected tab background and text color of TabLayout
body: <p>I want to change the selected tab background and text color from Java.
  I created this activity from Android studio build in activity and make a little change for me.
  My code is</p>
  
  <pre><code>public class BanglalinkInternetPack extends AppCompatActivity {
  
  private SectionsPagerAdapter mSectionsPagerAdapter;
  
  /**
   * The {@link ViewPager} that will host the section contents.
   */
  private ViewPager mViewPager;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_banglalink_internet_pack);
      //getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor("#f37022")));
  
      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);
  
      FloatingActionButton fab = (FloatingActionButton) 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();
          }
      });
  
  }
  
  
  /**
   * A {@link FragmentPagerAdapter} that returns a fragment corresponding to
   * one of the sections/tabs/pages.
   */
  public class SectionsPagerAdapter extends FragmentPagerAdapter {
  
      public SectionsPagerAdapter(FragmentManager fm) {
          super(fm);
      }
  
      @Override
      public Fragment getItem(int position) {
          // getItem is called to instantiate the fragment for the given page.
          // Return a PlaceholderFragment (defined as a static inner class below).
          switch (position){
              case 0:
                  return new Montly_pack_bl();
  
              case 1:
                  return  new Daily_packs_bl();
  
              case 2:
                  return  new Weekly_pack_bl();
  
              case 3:
                  return  new Montly_pack_bl();
  
          }
          return null;
      }
  
      @Override
      public int getCount() {
          // Show 4 total pages.
          return 4;
      }
  
      @Override
      public CharSequence getPageTitle(int position) {
          switch (position) {
              case 0:
                  return "Most Used";
              case 1:
                  return "Daily";
              case 2:
                  return "Weekly";
              case 3:
                  return "Monthly";
          }
          return null;
      }
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Where do I need to change?</p>