title: SlidingTabLayout and ViewPager: how to load the current fragment and not the adjacent one at the same time?
body: <p>I am trying to implement a sliding tab layout that and each fragment should only load when the tab is selected instead i get the adjacent fragment loading, I have tried setOffScreenPageLimit(1) as my code shows but still the adjacent fragment gets loaded any assistance please ???</p>
  
  <pre><code>private SlidingTabLayout tabLayout;
  private ViewPager viewPager;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);       
      viewPager = (ViewPager) findViewById(R.id.viewpager);
      viewPager.setAdapter(new MyPagerAdapter(getSupportFragmentManager()));
      viewPager.setOffscreenPageLimit(1);
      tabLayout = (SlidingTabLayout) findViewById(R.id.tabs);
      if (tabLayout != null) {
          tabLayout.setViewPager(viewPager);
          tabLayout.setDistributeEvenly(true);
          tabLayout.setSelectedIndicatorColors(R.color.md_amber_600);
      }
  </code></pre>