diff options
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ShowLocationActivity.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ShowLocationActivity.java b/src/main/java/de/pixart/messenger/ui/ShowLocationActivity.java index 38dc8fead..3bfecddfa 100644 --- a/src/main/java/de/pixart/messenger/ui/ShowLocationActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ShowLocationActivity.java @@ -168,6 +168,8 @@ public class ShowLocationActivity extends Activity implements OnMapReadyCallback @Override protected void onPreExecute() { super.onPreExecute(); + marker = mGoogleMap.addMarker(options); + marker.showInfoWindow(); mGoogleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(location, Config.DEFAULT_ZOOM)); } @@ -180,6 +182,7 @@ public class ShowLocationActivity extends Activity implements OnMapReadyCallback @Override protected void onPostExecute(Void result) { super.onPostExecute(result); + marker.remove(); options.snippet(String.valueOf(address)); marker = mGoogleMap.addMarker(options); marker.showInfoWindow(); @@ -190,7 +193,9 @@ public class ShowLocationActivity extends Activity implements OnMapReadyCallback mGoogleMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() { @Override public void onMapClick(LatLng latLng) { - marker.showInfoWindow(); + if (marker != null) { + marker.showInfoWindow(); + } } }); } |