title: I want to disable preloading next page in a ViewPager
body: <p>How can I disable the preloading in a ViewPager?</p>
  
  <p>I have a ViewPager with 3 pages fragment in each page. So I don't want to load the next page and previous page. How can I disable this behaviour?</p>
  
  <p>I tried</p>
  
  <blockquote>
    <p>viewPager.setOffscreenPageLimit(1)</p>
  </blockquote>
  
  <p>But this is not working.</p>
  
  <p>and tried </p>
  
  <pre><code>@Override
  public void setMenuVisibility(final boolean visible) {
      super.setMenuVisibility(visible);
      if (visible) {
          // do something nice here
      }
  }
  </code></pre>
  
  <p>but RecyclerView which in next fragment show this</p>
  
  <blockquote>
    <p>RecyclerView: No adapter attached; skipping layout</p>
  </blockquote>
  
  <p>apologize for my English </p>