Make Camera move as Location changes (Google Maps Api)
<p>I have a problem with google maps api. What I want to do is to move the camera along with the <strong>Location</strong> so the blue indicator always is in center.</p>

<p>Thought that a good place to put code is in the <strong>OnLocationChanged method</strong> but that was not the case.</p>

<p>I tried to run this code there:</p>

<pre><code>LatLng latlng = new LatLng(mLastLocation.getLatitude(),mLastLocation.getLongitude());
    CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(latlng,17);
    mMap.animateCamera(cameraUpdate);
</code></pre>

<p><strong>UPDATE</strong></p>

<p>So i can not do this then?</p>

<pre><code>@Override
public void onLocationChanged(Location location) {
mLocationRequest = LocationRequest.create()
        .setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY)
        .setInterval(10 * 1000)
        .setFastestInterval(1 * 1000);

    LatLng latLng = new LatLng(location.getLatitude(),location.getLongitude());
    CameraPosition cameraPosition = new CameraPosition.Builder()
            .target(latLng)
            .zoom(ZOOM)
            .bearing(0)
            .tilt(0)
            .build();
    mMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
}
</code></pre>