title: fragments visibility gone and visible on respective button click
body: <p>I have view pager and bottom navigation bar with five fragments, tried to hide other fragments when first fragment is called.</p>
  
  <pre><code>FragmentManager fm = getSupportFragmentManager();
  
  FragmentTransaction ft = fm.beginTransaction();
  
  protected void selectFragment(MenuItem item) {
      item.setChecked(true);
  
  
      switch (item.getItemId()) {
          case R.id.action_home:
              displayFragment(DefaultFragment.class);
              ft.hide(FavouriteFragment.class);//need help here
              break;
          case R.id.action_info:
              displayFragment(FavouriteFragment.class);
              break;
          case R.id.action_msg:
              displayFragment(NotifyFragment.class);
              break;
          case R.id.action_profile:
              displayFragment(ProfileFragment.class);
              break;
          case R.id.action_history:
              displayFragment(OrderHistoryFragment.class);
              break;
  
      }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/gPhDD.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gPhDD.jpg" alt="enter image description here"></a></p>
  
  <p>background you can see the previous fragments are coming, though the clicked fragment have background color blue</p>