title: BottomNavigationView set selected item background color programmatically
body: <p>I know we can set the bottom navigation selection color from XML in <a href="https://stackoverflow.com/a/52234495/13572333">this</a> way</p>
  <p>But I want to know how we can change it programmatically from my Activity?</p>
  <p>This is what I tried in Activity's <code>OnNavigationItemSelectedListener</code>.</p>
  <pre><code> item.getIcon().setTint(ContextCompat.getColor(context, R.color.colorBrown));
  </code></pre>
  <p>Also tried to change tint list like this:</p>
  <pre><code>item.setIconTintList(ColorStateList.valueOf(ContextCompat.getColor(context, R.color.colorPrimaryBlue)));
  </code></pre>
  <p>Here is the complete snippet of my code:</p>
  <pre><code>private BottomNavigationView.OnNavigationItemSelectedListener mOnNavigationItemSelectedListener
              = item -&gt; {
          switch (item.getItemId()) {
              case R.id.navigationTask:
                      item.getIcon().setTint(ContextCompat.getColor(context, R.color.colorBrown));
                  fragment = new MyTaskFragment();
                  break;
              case R.id.navigationProfile:
                      item.setIconTintList(ColorStateList.valueOf(ContextCompat.getColor(context, R.color.colorPrimaryBlue)));
                  fragment = new ProfileFragment();
                  break;
              case R.id.navigationRequest:
                  fragment = new RequestListFragment();
                  break;
              case R.id.navigationMore:
                  fragment = new MoreFragment();
                  break;
          }
          loadFragment(fragment);
          return true;
      };
  </code></pre>
  <p>but it's not working for me. Any ideas or reference link on how to change this programmatically will be helpful for me.</p>
  <p>Note: I want to change only the selected item's icon and text tint color. Not the entire items in the bottom navigation.</p>
  <p>Thanks in advance.</p>