title: ViewPager loads 2 fragments at the same time
body: <p>So I have 2 fragments and view pager. When I click on a button to load the first fragment the second fragment also gets loaded on the same screen.</p>
  <p>The adapter I am using:</p>
  <p>Adapter.java:</p>
  <pre><code>
  public class Adapter extends FragmentPagerAdapter {
      
      public Adapter(FragmentManager fm){
          super(fm);
      }
  
  
  
      @NotNull
      @Override
      public Fragment getItem(int position){
          if(position==0){
              return new SettingsFragment();
          }
          if (position==1){
              return new BlankFragment();
          }
          return  null;
      }
  
  
      @Override
      public int getCount(){
          return 2;
      }
  
  
  }
  </code></pre>
  <p>Any idea what's going on here?</p>