title: How to Hide Map Fragment - Android
body: <p>Using below code to <code>show</code> and <code>hide</code> <strong>MapFragment</strong>, and it works just well:    </p>
  
  <pre><code>public class MapFragmentActivity extends FragmentActivity {
  ...........
  mMapFragment = ((SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.map));
  googleMap = mMapFragment.getMap();  
  googleMap.setMyLocationEnabled(true);
  .....
  if(isChecked)
    {                                 
          mMapFragment.getView().setVisibility(View.VISIBLE);                                     
    }
    else 
    {
          mMapFragment.getView().setVisibility(View.GONE);
    }
  </code></pre>
  
  <p>but whenever i am using it with <code>Animation</code>, Map never hides, it always <code>visible</code>, whereas animation works for me;</p>
  
  <pre><code>if(isChecked)
      {               
          mMapFragment.getView().setVisibility(View.VISIBLE);
          mMapFragment.getView().startAnimation(AnimationUtils.loadAnimation(MapFragmentActivity.this,
           R.anim.slide_up));
      }
      else 
      {
          mMapFragment.getView().setVisibility(View.GONE);
          mMapFragment.getView().startAnimation(AnimationUtils.loadAnimation(MapFragmentActivity.this,
           R.anim.slide_down));
      }
  </code></pre>