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

Clear callbacks as part of OnDestroy #14035

Merged
merged 1 commit into from
Mar 6, 2019
Merged

Clear callbacks as part of OnDestroy #14035

merged 1 commit into from
Mar 6, 2019

Conversation

tobrun
Copy link
Member

@tobrun tobrun commented Mar 5, 2019

Closes #13967

This PR fixes the issue of not being able to restore a backstacked map fragment. The source of the issue stems from clearing out the OnMapReadyCallback as part of OnDestroyView, this is not correct and should only happen as part of OnDestroy. OnDestroyView can be called multiple times in a fragment life time, removing the callback makes reused fragment unusable as the callback isn't fired anymore.

Looked into adding a regression test but we need androidX for that, follow up ticket in https://github.com/mapbox/mapbox-gl-native/issues/14034.
For now I'm punting on the manual test added.

@tobrun tobrun added the Android Mapbox Maps SDK for Android label Mar 5, 2019
@tobrun tobrun added this to the release-l milestone Mar 5, 2019
@tobrun tobrun self-assigned this Mar 5, 2019
@tobrun tobrun requested a review from LukasPaczos March 5, 2019 09:57
@tobrun tobrun merged commit be75dc9 into master Mar 6, 2019
@tobrun tobrun deleted the tvn-backstack-fragment branch March 6, 2019 13:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MapView in SupportMapFragment breaks after popping from backstack
2 participants