Marker for location disappears when updating the location Android Studio
<p>In my app I have a button to get the location programmatically. Everything went well until I realized that once I added the location marker, each time I was requesting for the location a new marker was added. Therefore I added an if statement that in my opinion is logical enough but does not work as I would like. When I get the location the first time everything is good and a marker is placed. When I push the location button a second time, the marker is deleted and no new marker is added. The app compiles on my phone with no problem. What am I doing wrong?  </p>

<pre><code>    public void showCurrentLocation(MenuItem item) {
    if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &amp;&amp; ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
        // TODO: Consider calling
        //    ActivityCompat#requestPermissions
        // here to request the missing permissions, and then overriding
        //   public void onRequestPermissionsResult(int requestCode, String[] permissions,
        //                                          int[] grantResults)
        // to handle the case where the user grants the permission. See the documentation
        // for ActivityCompat#requestPermissions for more details.
        return;
    }
    Location currentLocation = LocationServices.FusedLocationApi
            .getLastLocation(mGoogleApiClient);
    if (currentLocation == null){

        LayoutInflater inflater = getLayoutInflater();
        View layout = inflater.inflate(R.layout.toast_gps_view, null);

        Toast toast = new Toast(getApplicationContext());
        toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
        toast.setDuration(Toast.LENGTH_LONG);
        toast.setView(layout);
        toast.show();


        Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
        startActivity(intent);


    } else {
        LatLng latLng = new LatLng(
                currentLocation.getLatitude(),
                currentLocation.getLongitude()
        );


        CameraUpdate update = CameraUpdateFactory.newLatLngZoom(latLng, 16);
        mMap.animateCamera(update);


        if (myPosition != null){
            myPosition.remove();
        } else {
            myPosition = mMap.addMarker(new MarkerOptions()
                    .icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_location_icon))
                    .position(latLng)
                    .title("I'm here!"));

        }

    }

}
</code></pre>