You can add a local variable in your listener and use it to zoom only for the first location. The code would look like:
private class Mylocationlistener implements LocationListener {
private boolean zoomed = false;
@Override
public void onLocationChanged(Location location) {
if (location != null) {
// ---Get current location latitude, longitude---
Log.d("LOCATION CHANGED", location.getLatitude() + "");
Log.d("LOCATION CHANGED", location.getLongitude() + "");
currentLocation = new LatLng(location.getLatitude(), location.getLongitude());
currentLatLng = new LatLng(location.getLatitude(), location.getLongitude());
Marker currentLocationMarker = map.addMarker(new MarkerOptions().position(currentLocation).title("Current Location"));
// Move the camera instantly to hamburg with a zoom of 15.
map.moveCamera(CameraUpdateFactory.newLatLngZoom(currentLatLng, 15));
// Zoom in, animating the camera.
if (!zoomed) {
map.animateCamera(CameraUpdateFactory.zoomTo(12), 2000, null);
zoomed = true;
}
if (!firstPass){
currentLocationMarker.remove();
}
firstPass = false;
Toast.makeText(MapViewActivity.this,"Latitude = "+
location.getLatitude() + "" +"Longitude = "+ location.getLongitude(),
Toast.LENGTH_LONG).show();
}
}