In my app I use an Activity with Fragment with MapView. When I open this Activity and close it, MapView.onDestroy does-not-return causing an ANR
I have included a sample app showing this
MapBoxFreeze.zip
See traces.txt for the ANR
traces.txt
Platform: Android 8.1
Mapbox SDK version: mapbox-android-sdk:5.3.0
Does not freeze
Freezes
In the sample app, please don't forget to add a working access token in MainActivity.java
I have commented out the calls the MapView.onDestroy() as a workaround. What is the effect of this?
You need to call MapView#onDestroy as part of Fragment#onDestroyView and not Fragment#onDestroy
Most helpful comment
You need to call
MapView#onDestroyas part ofFragment#onDestroyViewand notFragment#onDestroy