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

MapView hook into View removal, resolve freeze #11685

Closed
tobrun opened this issue Apr 16, 2018 · 10 comments
Closed

MapView hook into View removal, resolve freeze #11685

tobrun opened this issue Apr 16, 2018 · 10 comments
Labels
Android Mapbox Maps SDK for Android

Comments

@tobrun
Copy link
Member

tobrun commented Apr 16, 2018

We have heard about issues of fragments not correctly integrating into our SDK due to MapView#onDestroy only being called by Fragment#onDestroy while it should be called by Fragment#onDestroyView.

The underlying issue is that the render surface needs to be destroyed before we remove the hosting view. We should analyse if it's possible to hook into view removal and call MapView#onPause/MapView#onStop/MapView#onDestroy as part of it.

@tobrun tobrun added the Android Mapbox Maps SDK for Android label Apr 16, 2018
@tikimcfee
Copy link

We should analyse if it's possible to hook into view removal and call MapView#onPause/MapView#onStop/MapView#onDestroy as part of it.

+1! +5! This would be great! It's tough to get some attach/detach flows working from the outside looking in when doing things like animation or manual view management (remove and reattach somewhere else). Wish you luck on this, and hope the Android view listening APIs give ya enough info.

@tobrun
Copy link
Member Author

tobrun commented May 11, 2018

Announced at Google I/O was the following editor for app flow:

screenshot from 2018-05-11 10-45-50

It looks like the code generated for that shows using a static fragment:

screenshot from 2018-05-11 10-43-12

Since this issue is reproducible with static fragments, I think we should prioritize this.

cc @mapbox/maps-android

@stale
Copy link

stale bot commented Jan 13, 2019

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

@stale stale bot closed this as completed Jan 13, 2019
@tobrun tobrun reopened this Jan 14, 2019
@stale stale bot removed the archived Archived because of inactivity label Jan 14, 2019
@ghost
Copy link

ghost commented Feb 8, 2019

Any updates on this issue?

@tobrun
Copy link
Member Author

tobrun commented Feb 8, 2019

Yes, still under investigation, the gist is that we try to cleanup the map while the render thread is already destroyed. We need a refactoring in setup to resolve this.

@tobrun
Copy link
Member Author

tobrun commented Feb 11, 2019

The issue was introduced as part of 18bb6da. There are situations where the underlying GL render thread is already destroyed (one example being Fragment setup with destroy/destroyView ). In those case it freezes as resetRenderer is never called.

@fredo-
Copy link

fredo- commented Jul 26, 2019

Sorry, I'm still a little confused @tobrun. How does this last merge request fix issue #10205?
My main issue being: if I'm using Conductor with Mapbox, where do I call mapView.onDestroy()? Since calling it in Conductor's onDestroyView() crashes the app.

@zugaldia
Copy link
Member

@fredo- thanks for the feedback on Conductor. Would you mind cutting a separate ticket about the issue you're seeing to avoid conflating the two conversations?

@kshailes
Copy link

kshailes commented Mar 19, 2020

I can't find solution anywhere? How is it closed?

@zugaldia
Copy link
Member

@kshailes we believe this issue was solved by #13926. If you're still observing this freeze, please cut a separate ticket on https://github.com/mapbox/mapbox-gl-native-android and the team will follow up. Thanks.

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

No branches or pull requests

6 participants