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

Programmatically create GlSurfaceView #11124

Merged
merged 1 commit into from
Feb 8, 2018
Merged

Conversation

tobrun
Copy link
Member

@tobrun tobrun commented Feb 6, 2018

This PR solves a very strange bug with activity recreation and fragments:

Debugging shows when you recreate the activity, I'm seeing 2 fragments being recreated and both share the same SurfaceView which results in the setRenderer has already been called for this instance exception. This should not happen as they both do layout inflation on their own. Creating the SurfaceView programmatically resolves the issue though can't really explain why both fragments share the same SurfaceView.

Closes #11121

@tobrun tobrun added the Android Mapbox Maps SDK for Android label Feb 6, 2018
@tobrun tobrun added this to the android-v5.4.1 milestone Feb 6, 2018
@tobrun tobrun self-assigned this Feb 6, 2018
@LukasPaczos
Copy link
Member

Digging through web shows post from Android framework engineers stating that SurfaceView should have only one instance as it draws independently of all the other views, it's not intended to overlap and that probably results in a shared renderer error when we create 2 overlapping fragments, because of the missed savedInstance, in #11121. We can try to harden it for now but I'm afraid it might cause some problems in the future/other devices anyways.

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