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
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user