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

Check if the map is destroyed before saving state in a fragment #12804

Merged
merged 1 commit into from
Sep 4, 2018

Conversation

LukasPaczos
Copy link
Member

Fixes #12803.

In a ViewPager setup, once created fragment doesn't need to be detached when its view is destroyed, meaning, that the out-of-view fragment is re-attached on orientation change but its view is not created, therefore the MapView is null. Also, when the fragment is attached, the onSaveInstanceState will be called resulting in the NPE.

@LukasPaczos LukasPaczos added the Android Mapbox Maps SDK for Android label Sep 4, 2018
@LukasPaczos LukasPaczos added this to the android-v6.5.0 milestone Sep 4, 2018
@LukasPaczos LukasPaczos merged commit 18b43f2 into master Sep 4, 2018
@LukasPaczos LukasPaczos deleted the 12803-view-pager-savestate branch October 26, 2018 13:07
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.

None yet

2 participants