Select to view content in your preferred language

Map is freezed when switching back to the app on Android 14

1401
5
02-04-2024 11:12 PM
EirikH
by
Occasional Contributor

I'm wondering if this is something with our specific app or not so I'm reaching out here to see if anyone else has seen this.

On devices with Android 14 we are seeing that if you have our app open with the map visible, switch to another app for minimum 10-15s (without fully closing our app), and then go back to our app, you can't interact with the map anymore (can't pan, click, zoom). If you rotate the device so it re-renders, things are back again.

We are running 100.15.1 in production, and it is also happening with 100.15.4. It is not happening with the iOS version of our app.

Edit: It's worth mentioning that other UI elements in our app (e.g. buttons on top of the map) work after switching back to the app, it's just the map that doesn't accept interactions anymore.

Edit2: We haven't been able to reproduce in simulator thus far, only on physical devices.

5 Replies
EirikH
by
Occasional Contributor

As a workaround we are listening on app state changes (inactive/background vs active) and once it is active again we manually force it to update:

 

 mapview.pause();
 mapview.resume();
 mapview.invalidate();

 

PS: It might be that mapview.invalidate() is enough, but haven't verified that on all applicable devices yet.

 

0 Kudos
FelicityRhone
Occasional Contributor

I am running into the same issue - not just you! I'm using the ArcGIS Runtime for Xamarin Forms (seeing this in 100.15.2) - I wasn't able to get your workaround working in my app 😞

Update: I was able to get the workaround sort-of working using reflection to call Pause/Resume (in a custom MapViewRenderer for Android). It makes the map render properly for panning/zooming, but when I have geolocation on it crashes the app with a SIGSEGV when the geolocation pulse tries to draw.

Tags (1)
FelicityRhone
Occasional Contributor

Esri posted an update on another post which I think would apply here too:
https://community.esri.com/t5/net-maps-sdk-questions/android-map-is-frozen-when-resuming-app/m-p/140...

EirikH
by
Occasional Contributor

Thanks for the update @FelicityRhone 

0 Kudos
esp1rl
by
Occasional Contributor

I found a workaround by altering the MapView layout on app resume.

My workaround is for the .NET SDK. Please see code in the other thread.

0 Kudos