viewpager setCurrentItem not changing tablayout selected color
<p>i am using viewpager and tab layout </p>

<pre><code>     viewPager.setAdapter(Adapter);
   tablayout.setupWithViewPager(viewPager);

   viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
        int cPage;

        @Override
        public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
        }

        @Override
        public void onPageSelected(int position) {


                cPage = position;

        }

        @Override
        public void onPageScrollStateChanged(int state) {

        }
    });
</code></pre>

<p>now when i swipe selected tab color is changing but when i call</p>

<pre><code>                viewPager.setCurrentItem(1, true);
</code></pre>

<p>its not changing new tab layout color . say
 i have 2 tabs when i am 1st it setting text color green for 1st tab and when i swipe it giving 2nd tab color green .. but when i call </p>

<pre><code>            viewPager.setCurrentItem(1, true);
</code></pre>

<p>in this my 1st tab is green not 2nd tab </p>