xamarinxamarin.androidmauisamsung-mobile

Xamarin/MAUI Open Google Maps without going into split screen mode in Android


I am opening Google maps with the following line of code:

 await Map.OpenAsync ( location, options );

This was previously working fine. However since upgrading to Android 13, it now opens Google maps in split screen mode, with Google maps at the top and App at the bottom. This only occurs on Samsung phones, it doesn't occur on the Pixel emulator. It occurs in both Xamarin and MAUI (we currently have both versions of the app)

To try and stop this happening, I have tried adding ResizeableActivity = false in both the Activity and the Application. This doesn't stop the app from going into split screen, all it does it make the app go fully black when in split screen mode.

I have also tried the following. This works when opening something like AppInfo.ShowSettingsUI(); and stops it opening in split screen, but it doesn't stop Google Maps from opening in split screen.

public override void StartActivity(Intent intent)
{
    intent.RemoveFlags(ActivityFlags.LaunchAdjacent);
    base.StartActivity(intent);
}

How do I go about stopping this from happening and opening Google Maps in a new full screen window?


Solution

  • This has been fixed in the latest version of VS (17.5)