Minimum reproducible repo: https://gitlab.com/pclark3/arcgisruntime-maui-freeze
Device Model: SM-T738U (Galaxy Tab S7 FE 5G)
Device Android Version: 14
Samsung One UI Version: 6.1
After using Share.Default.RequestAsync on a Samsung tablet, the MapView becomes frozen. There is a similar post to this issue but the workaround presented in that post does not work for this issue.
Thank you.
Do you _only_ see the issue on this device, or is it the only device you've been testing on? (what devices do you have that it worked on?)
Does LogCat give any indication of an issue with the application?
My other devices are a Pixel 8 XL and the usual Android Studio emulators. Not a huge repertoire, but yes, currently only reproducible on my Samsung tablet (and my coworker's Samsung tablet).
Actually not sure how to upload a file here, but I did not see anything of interest in logcat. Also very possible I'm not experienced enough to find it. Here is a pastebin of the logcat from before clicking the button to after coming back to the map: https://pastebin.com/ix88Ptiz
Thank you for sharing the log. I do see the rendering stops for the mapview on share (which is expected), but I don't see a resume. As an experiment could you after sharing, try and remove the mapview from the view and re-insert it? Would that make it start up again? That would confirm if we're having some issues detecting resume.
I added the following code immediately after await Share.Default.RequestAsync and it does result in a fresh map that can be interacted with.
AbsLayout.Children.RemoveAt(0);
var mapView = new MapView();
mapView.Map = new Map(new Basemap([new OpenStreetMapLayer()]));
AbsLayout.Children.Insert(0, mapView);
AbsoluteLayout.SetLayoutBounds(mapView, new Rect(0, 0, 1, 1));
AbsoluteLayout.SetLayoutFlags(mapView, AbsoluteLayoutFlags.SizeProportional);
Thanks for confirming. You shouldn't have to re-create a new MapView. Just re-insert the same one.
One more thing to also try. Could you try and add this to MainActivity?
public class MainActivity : MauiAppCompatActivity
{
public MainActivity()
{
Lifecycle.AddObserver(new Observer());
}
private class Observer : Java.Lang.Object, AndroidX.Lifecycle.IDefaultLifecycleObserver, AndroidX.Lifecycle.ILifecycleObserver
{
void IDefaultLifecycleObserver.OnCreate(ILifecycleOwner p0) => System.Diagnostics.Debug.WriteLine("***Lifecycle.OnCreate");
void IDefaultLifecycleObserver.OnDestroy(ILifecycleOwner p0) => System.Diagnostics.Debug.WriteLine("***Lifecycle.OnDestroy");
void IDefaultLifecycleObserver.OnPause(ILifecycleOwner p0) => System.Diagnostics.Debug.WriteLine("***Lifecycle.OnPause");
void IDefaultLifecycleObserver.OnResume(ILifecycleOwner p0) => System.Diagnostics.Debug.WriteLine("***Lifecycle.OnResume");
void IDefaultLifecycleObserver.OnStart(ILifecycleOwner p0) => System.Diagnostics.Debug.WriteLine("***Lifecycle.OnStart");
void IDefaultLifecycleObserver.OnStop(ILifecycleOwner p0) => System.Diagnostics.Debug.WriteLine("***Lifecycle.OnStop");
}
}
When I do this, this is what I see in the output window once the app comes back from the sharing operation. I'd be curious if that differs on your Samsung device:
[TextureView] Paused by user
[TextureView] Stopping pulse
[0:] ***Lifecycle.OnPause
[0:] ***Lifecycle.OnStop
[0:] ***Lifecycle.OnStart
[0:] ***Lifecycle.OnResume
[TextureView] Resumed by user. Texture view available: True
[TextureView] Starting pulse
Attached is the log file with your lifecycle logging
I began logging right before clicking the share button, and stopped logging immediately upon returning to the map. What I see on my end:
***Lifecycle.OnPause
***Lifecycle.OnStop
***Lifecycle.OnDestroy
***Lifecycle.OnCreate
***Lifecycle.OnStart
***Lifecycle.OnResume
TextureView does some things
There was no "TextureView Paused by user" or "stopping pulse" messages prior to the Lifecycle.OnPause like in your reply.
It is worth noting that I tried simply re-adding the mapview to the view hierarchy but this resulted in a blank map (with ESRI logo banner at bottom). The log files were with this commented out.
var mapView = AbsLayout.Children[0] as MapView;
AbsLayout.Children.RemoveAt(0);
AbsLayout.Children.Insert(0, mapView);
AbsoluteLayout.SetLayoutBounds(mapView, new Rect(0, 0, 1, 1));
AbsoluteLayout.SetLayoutFlags(mapView, AbsoluteLayoutFlags.SizeProportional);
I'm not entirely if you're saying the above log was with replacing with a new mapview on resume? If that's the case, could you try it with just leaving the mapview alone as in the original sample you shared? (it's fine that the map is blank - but I'd like to understand if something on your device is not triggering these lifecycle events, since the MapView heavily relies on these to resume rendering).
I do find it curious so far that you are seeing destroy+create. That could be the root of how these devices behave differently. If you repeat this on a device that does work, do you see a version of mine or your log?
Lastly what does "TextureView does some things" mean?
Sorry for the confusion. Those logs are without your suggested workaround of re-adding the MapView to the hierarchy. I may have made a mistake with my previous listing, please disregard... below is what I see in the log file I attached for you. I have included line numbers on the far left. I have also attached a video of the issue happening.
2161 [app_process64] ***Lifecycle.OnCreate
2178 [app_process64] ***Lifecycle.OnStart
2179 [app_process64] ***Lifecycle.OnResume
2300 [TextureView] onSurfaceTextureAvailable
2301 [TextureView] full init
2305 [TextureView] Detected version: OpenGL ES 3.2 V@0502.39.1 (GIT@47c5f1d498, I45cbc356ca, 1746971642) (Date:05/11/25)
2306 [TextureView] eglCreateContext succeeded for OpenGLES version 3
2323 [TextureView] onSurfaceTextureAvailable done
2324 [TextureView] Starting pulse
2703 [TextureView] Paused by user
2708 [app_process64] ***Lifecycle.OnPause
2709 [TextureView] Stopping pulse
3274 [TextureView] onSurfaceTextureSizeChanged 1600 2322
3277 [TextureView] Starting pulse
4451 [app_process64] ***Lifecycle.OnResume
4548 [TextureView] onSurfaceTextureSizeChanged 1600 2271
4552 [TextureView] Stopping pulse
4566 [TextureView] Starting pulse
I'll try this on my Pixel 8 and get back with you.
$ grep 'TextureView\|***Lifecycle' pixel8_log.txt
2025-09-17 07:07:29.837 2591-2591 TextureView com.companyname.arcgisruntimefreeze I Paused by user
2025-09-17 07:07:29.838 2591-2591 app_process64 com.companyname.arcgisruntimefreeze D ***Lifecycle.OnPause
2025-09-17 07:07:29.839 2591-2818 TextureView com.companyname.arcgisruntimefreeze I Stopping pulse
2025-09-17 07:07:31.995 2591-2591 app_process64 com.companyname.arcgisruntimefreeze D ***Lifecycle.OnResume
2025-09-17 07:07:31.996 2591-2591 TextureView com.companyname.arcgisruntimefreeze I Resumed by user. Texture view available: True
2025-09-17 07:07:31.997 2591-2818 TextureView com.companyname.arcgisruntimefreeze I Starting pulse
$ grep 'TextureView\|Lifecycle\.' samsung_galaxytab_log.txt
2025-09-17 07:14:01.541 10778-10778 TextureView com.companyname.arcgisruntimefreeze I Paused by user
2025-09-17 07:14:01.542 10778-10832 TextureView com.companyname.arcgisruntimefreeze I Stopping pulse
2025-09-17 07:14:01.543 10778-10778 app_process64 com.companyname.arcgisruntimefreeze D ***Lifecycle.OnPause
2025-09-17 07:14:02.174 10778-10778 TextureView com.companyname.arcgisruntimefreeze I onSurfaceTextureSizeChanged 1600 2322
2025-09-17 07:14:02.177 10778-10832 TextureView com.companyname.arcgisruntimefreeze I Starting pulse
2025-09-17 07:14:04.168 10778-10778 app_process64 com.companyname.arcgisruntimefreeze D ***Lifecycle.OnResume
2025-09-17 07:14:04.223 10778-10778 TextureView com.companyname.arcgisruntimefreeze I onSurfaceTextureSizeChanged 1600 2271
2025-09-17 07:14:04.224 10778-10832 TextureView com.companyname.arcgisruntimefreeze I Stopping pulse
2025-09-17 07:14:04.233 10778-10832 TextureView com.companyname.arcgisruntimefreeze I Starting pulse