Email.ComposeAsync behaves incorrectly on the Pixel 6.

oiqbal 1 Reputation point
2022-06-08T21:13:43+00:00

On other Android devices that we tested, the email function provided by Xamarin.Essentials worked as intended. The app opened the email app with the provided subject, recipient, and body fields filled out. On the Pixel 6 (Android version 12) we ran into an issue where instead of opening up the email app as a fullscreen application, it instead opened it up in a multi-window view.

The main issue is that the Android's MainActivity's OnCreate gets called when this happens and restarts the app as if it was booted for the first time (The MainActivity's LaunchMode is set to LaunchMode.SingleTask). In the AndroidManifest, I can disable multi-window mode by using android:resizeableActivity="false." This gets rid of the multi-window issue and also the issue of the app restarting. However, now the issue is the email app gets loaded in the background instead of automatically sending the user to the email app. The user has to manually switch over to the email app to get to it. Both of these situations are not ideal so we are asking here in hopes of a fix or workaround.

IyC0UXY.png

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,301 questions
{count} votes