In my project I am using Google Map V2 and Map Utils for clustering map from this library: https://github.com/googlemaps/android-maps-utils . I have use STOMP on my project and whenever I receive new data I need to update the marker, and I have done it by removing all marker from cluster manager and re-adding them. But now my issue is whenever a a user clicks on marker a InfoWindow of marker is shown to the user and after than If I receive a data new data a InfoWindow will be closed due to calling mClusterManager.cluster(); function. Now, My question is how to show a InfoWindow after Cluster is refreshed.
Below are my codes:
googleMap.setOnMarkerClickListener(mClusterManager);
addClusterMarkers(mClusterManager);
mClusterManager.getMarkerCollection().setOnInfoWindowAdapter(new CustomAdapterInfoWindow());
mClusterManager.setOnClusterItemClickListener(new ClusterManager.OnClusterItemClickListener<AppClusterItem>() {
@Override
public boolean onClusterItemClick(AppClusterItem appClusterItem) {
showingInfoWindowId = appClusterItem.getmId();
return false;
}
});
googleMap.setOnMarkerClickListener(mClusterManager);
//New Data Update
on NewDataReceived(String _id){
mClusterManager.clearItems();
addClusterMarkers(mClusterManager);
mClusterManager.cluster();
try {
Log.d(Constants.TAG, appClusterItemList.size() + "Showing Info Window" + activeDataKey.get(_id));
render.getMarker(appClusterItem[0]).showInfoWindow();
} catch (Exception e) {
Log.d(Constants.TAG, "" + e);
}
mClusterManager.cluster();
}
});
}
I want to show an ShowInfoWindow() after data is received if until user click the marker again. (Clicking marker again will hide showInfoWindow (Default))
If anyone can answer my previous question I would be happy, because I want it to do better way, just updating single item. see here : Update single item GoolgeMap Cluster