0

I have this problem White screen is displayed while switching between Activities

When I try to send an email using Xamarin.Essentials.Email.ComposeAsync I get a white screen. This method is inside a Fragment rather than an Activity class so I can't use android:name on the <activity> element.

I want to know if I can implement the style on my current Manifest.xml file

<queries>
    <intent> //add android:theme="@style/MyTheme" somewhere here???
        <action android:name="android.intent.action.SENDTO" />
        <data android:scheme="mailto" />
    </intent>
</queries>

1 Answers1

0

I had tried to use the Xamarin.Essentials.Email.ComposeAsync and met the same problem. But the reason of the white screen shows is the email app which you had launched.

When we use the Xamarin.Essentials.Email.ComposeAsync to send an email, it will launch the default email app which the Xamarin.Essentials.Email support such as the GMail. And the white screen is the preview window of GMail.

We can change the preview window of our app by customing a theme which sets the 'android:windowDisablePreview', but we can't change the others.

If you need more information, you can check the answer's link in the case you mentioned.

Liyun Zhang - MSFT
  • 8,271
  • 1
  • 2
  • 14
  • The email client displays correctly. My app itself is the one with the white screen. When I go back to the app from the email client it will be permanently on white screen –  Mar 10 '22 at 09:33
  • Do you mean that when you go back from the email client to the fragment in your app, the white screen is always here?@r123 – Liyun Zhang - MSFT Mar 10 '22 at 09:45
  • yes thats right –  Mar 10 '22 at 09:49
  • I had done a demo which called the Xamarin.Essentials.Email.ComposeAsync method in a fragment, but it worked well. When I came back from the Gmail, there was no white sreen. When it shows the white screen, can you get back to your fragment by tapping the back button.@r123 – Liyun Zhang - MSFT Mar 11 '22 at 07:54
  • In addition, you can try to add "false" to the style.xml in the values folder. – Liyun Zhang - MSFT Mar 11 '22 at 07:59
  • No when I tap the back button I am logged out of my app. Adding the styles hasn't fixed this problem either –  Mar 11 '22 at 14:17
  • I can't repeat your problem, can you post your project to the github and attach the link here? – Liyun Zhang - MSFT Mar 14 '22 at 05:42