title: Get Google Maps to automatically zoom in on my Current Location?
body: <p>Possible duplicate of <a href="https://stackoverflow.com/questions/14074129/google-maps-v2-set-both-my-location-and-zoom-in">Google Maps v2 - set both my location and zoom in</a></p>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_g_maps);
          GoogleMap googleMap;
          LatLng myPosition;
  
  
          SupportMapFragment fm = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
  
          googleMap = fm.getMap();
          googleMap.setMyLocationEnabled(true);
          LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
          Criteria criteria = new Criteria();
          String provider = locationManager.getBestProvider(criteria, true);
          Location location = locationManager.getLastKnownLocation(provider);
  
                  if(location!=null){
          double latitude = location.getLatitude();
          double longitude = location.getLongitude();
          LatLng latLng = new LatLng(latitude, longitude);
          myPosition = new LatLng(latitude, longitude);
  
  
      }
  
  }
  }
  </code></pre>
  
  <p>I've tried adding:</p>
  
  <pre><code>CameraUpdate center=
          CameraUpdateFactory.newLatLng(new LatLng(latitude,
                                                   longitude));
      CameraUpdate zoom=CameraUpdateFactory.zoomTo(15);
  
      googleMap.moveCamera(center);
      googleMap.animateCamera(zoom);
  </code></pre>
  
  <p>or</p>
  
  <pre><code> googleMap.moveCamera( CameraUpdateFactory.newLatLngZoom(new LatLng(latitude, longitude) ,4) );
  </code></pre>
  
  <p>but Google Maps doesn't automatically zoom in once I've hit the button which calls this method. I still get the Google UI which I can click to zoom in on my Location, but I want it to automatically zoom in.</p>
  
  <p>Any help please?</p>