diff options
author | Tobrun <tobrun.van.nuland@gmail.com> | 2016-10-17 14:50:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-17 14:50:09 +0200 |
commit | bda0e94af2a6f6ddb7e61f2aecdf6a50479a6b32 (patch) | |
tree | 79027cfe47da4f66fed2b5b6ec316c731341e338 /platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation | |
parent | b3468f5db7101c847f17e05a8bcb830228d3b144 (diff) | |
download | qtlocation-mapboxgl-bda0e94af2a6f6ddb7e61f2aecdf6a50479a6b32.tar.gz |
MarkerView more robust when updates are asynchronous (#6717)
* [android] - remove ViewMarkers crash, show correct view cache size in test activity
* use MapboxMap to indicate a MarkerView is no longer added on a map, no future updates will be passed on to core.
* resolve memory leak
Diffstat (limited to 'platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation')
-rw-r--r-- | platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/MarkerViewActivity.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/MarkerViewActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/MarkerViewActivity.java index 8d678794c4..fe20b75a8d 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/MarkerViewActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/MarkerViewActivity.java @@ -146,7 +146,7 @@ public class MarkerViewActivity extends AppCompatActivity { public void onMapChanged(@MapView.MapChange int change) { if (change == MapView.REGION_IS_CHANGING || change == MapView.REGION_DID_CHANGE) { if (!markerViewManager.getMarkerViewAdapters().isEmpty() && viewCountView != null) { - viewCountView.setText("ViewCache size " + (mapView.getChildCount() - 5)); + viewCountView.setText("ViewCache size " + mapView.getMarkerViewContainer().getChildCount()); } } } @@ -194,6 +194,7 @@ public class MarkerViewActivity extends AppCompatActivity { protected void onStop() { super.onStop(); locationUpdateHandler.removeCallbacks(moveMarkerRunnable); + rotateUpdateHandler.removeCallbacks(rotateMarkerRunnable); } /** |