title: How to set TabLayout.Tab background color programmatically?
body: <p>I need to change the background color of the selected tab when the user click on it to white. </p>
  
  <p>Those two attempts are not working (the first is commented)</p>
  
  <pre><code>tabLayout.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
              @Override
              public void onTabSelected(TabLayout.Tab tab) {
  //                LinearLayout parent = new LinearLayout(getApplicationContext());
  //                parent.setLayoutParams(new LinearLayout.LayoutParams(LinearLayoutCompat.LayoutParams.MATCH_PARENT, LinearLayoutCompat.LayoutParams.WRAP_CONTENT));
  //                parent.setBackgroundColor(getResources().getColor(R.color.white));
  //                tab.setCustomView(parent);
                  tabLayout.getTabAt(tabLayout.getSelectedTabPosition()).setBackgroundColor(getResources().getColor(R.color.white));
              }
  
              @Override
              public void onTabUnselected(TabLayout.Tab tab) {
  
              }
  
              @Override
              public void onTabReselected(TabLayout.Tab tab) {
  
              }
          });
  </code></pre>