You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
SupportMapFragment only retains a reference to a single OnMapReadyCallback, which it passes to its MapView in onStart(). It does not test this reference for null. Nor does it clear this reference, so the callback will be called again every time onStart() runs. Compare this to the behavior of MapView, which retains a collection of callbacks and removes them as they are called.
Is there a reason SupportMapFragment#getMapAsync(...) doesn't simply call through to MapView#getMapAsync(...)?
Forwarding the fragment's getMapAsync(...) directly to MapView#getMapAsync(...) seems to work fine. The only problem is that Fragment#onCreate(...) is called before Fragment#onCreateView(...), so the fragment still has to store and forward callbacks before onCreateView(...).
Activity
kjkrum commentedon Dec 17, 2016
Forwarding the fragment's
getMapAsync(...)directly toMapView#getMapAsync(...)seems to work fine. The only problem is thatFragment#onCreate(...)is called beforeFragment#onCreateView(...), so the fragment still has to store and forward callbacks beforeonCreateView(...).