Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

SupportMapFragment and OnMapReadyCallback #7440

Closed

Description

@kjkrum

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(...)?

Activity

  1. added
    Android
    on Dec 14, 2016
  2. kjkrum commented on Dec 17, 2016

    @kjkrum
    Author

    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(...).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Android

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions