I think this only occurs on Samsung phones, on Android 14.
It's a problem in our production app, but also easy to reproduce in a new Maui app (I shared my demo app here https://github.com/Felicity-R/EsriMapTest/issues).
Repro steps:
Possibly related to this issue someone reported in the Runtime SDK for Android: https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/map-is-freezed-when-switching...
\* watching the logs, I know the map will be frozen after I see this message come up while backgrounded:
[Choreographer] CoreRune.SYSPERF_ACTIVE_APP_BBA_ENABLE : stop animation in background states
Oh yeah, and this also occurs in the older version of our app, using Xamarin Forms (5.0.0.2337) and Esri.ArcGISRuntime 100.15.2.
I also wonder if this is connected to https://github.com/flutter/flutter/issues/139630 which people are saying might be an issue on Samsung's side? But if there's any kind of workaround that Esri or our team could implement that would be ideal.
I can report we're experiencing the same on Samsung devices.
I also want to report this bug, on Samsung device. It often occurs after transitioning to the foreground. After going to a new page and back when re-initializing the map view. The map view has started working again.
Esri has logged a bug for this issue:
BUG-000166099 Map view interactions freeze after returning to ArcGIS Maps SDK for .NET MAUI Android App on physical Samsung Galaxy devices with Android 14
As @FelicityRhone suggested, the issue is caused by a flutter/samsung bug.
The issue might be fixed in the Samsung's OneUI 6.1 patch, which should have been rolling out in the last couple of days. However, this isn't confirmed by users yet.
My team was able to test this today on both a Samsung Galaxy Z Flip and a Samsung Galaxy Tab S8, both with Android 14, and with OneUI updated to 6.1.
Unfortunately, the bug is not resolved by the new version of OneUI.
We did do a test of an Android 15 beta a while back and that *does* seem to fix the issue. But with Android 14 it's still a problem.
It should not be marked as resolved. Problem is still there. As I write in the post below.
I confirm that the update to OneUI 6.1 did not resolve the bug. It is still appearing. You have to spend a few seconds outside of the app, and the MapView will freeze (going to background or web view).
I tried to reinitialize the map on onAppearingEvent, but that didn’t help. Is there any workaround or solution? This is a really big problem for mobile maps.
I found a workaround by altering the MapView layout on app resume.
public partial class App : Application
{
#if ANDROID
protected override async void OnResume()
{
base.OnResume();
// ISSUE: Map may be frozen when app is resumed
// https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/map-is-freezed-when-switching-back-to-the-app-on/td-p/1378043
// https://community.esri.com/t5/net-maps-sdk-questions/android-map-is-frozen-when-resuming-app/m-p/1404692
if (MainPage is Shell { CurrentPage: MapPage { IsLoaded: true } mapPage })
{
// wait for the app to be resumed before applying fix
await Task.Delay(TimeSpan.FromSeconds(1));
mapPage.FixMapViewFreeze();
}
}
#endif
}
Then add this for the map page.
#if ANDROID
internal void FixMapViewFreeze()
{
// apply a temporary margin to force a redraw
MapView.Margin = new Thickness(0, 0, 0, 1);
// wait for the UI thread to process the layout change and then reset the margin
Dispatcher.DispatchDelayed(TimeSpan.FromMilliseconds(50), () => MapView.Margin = Thickness.Zero);
}
#endif