question

NiloMOBRJ avatar image
0 Votes"
NiloMOBRJ asked WenyanZhang-MSFT answered

Button click on HomePage shows SplashScreen after OnSleep app

Hello,
I am having a hard time with a buggy behavior in a client app, so I tried to reproduce it on a sample at GitHub. Sometimes when minimize the app and reopen it, it is getting stuck in SplashScreen after clicking a HomePage button that goes to a NavigationPage.

Steps to reproduce:

  • On Debug mode, start the app and click the "Go to Tabs" button at HomePage

  • When done use Android Home button to minimize the app - OnSleep (do not swipe to close completely)

  • Re-open the app and you are going to see the HomePage again

  • Click the "Go to Tabs" button and get stuck at white SplashScreen

Here I give a sample to reproduce the bug:
https://github.com/nilomobrj/xf-buggy-sample/tree/main/Tab

Also uploaded a video to demonstrate:
https://youtu.be/9ZlPYznG9zE

Thanks in advance for any help!

dotnet-xamarin
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

May I ask what the device did you test on ?I can't reproduce this issue by my phone(Android 10.0) and Android emulator. By the way, the last step, do you mean click the "Go Home Page" button rather than "Go to Tabs" button?

0 Votes 0 ·

Hello, I uploaded a video to try make it clear. Hope it helps, thanks again!
https://youtu.be/9ZlPYznG9zE

I have tested it on Android emulator (Android 9.0), and last step is the "Go to Tabs" button because it is supposed to show the HomePage when reopening the app instead the tabs page. But it just happens in debug mode, meanwhile in the client app he told it is happening sometimes.

0 Votes 0 ·

I notice that you use VS for mac, so I test the demo with a mac. This issue has been reproduced by Xamarin.Forms 4.8. However, it crashes when I click the "Go Home Page"button. May I ask what the verion of VS you used? I'm afraid you could update the Xamarin.Forms package first.

0 Votes 0 ·
Show more comments

1 Answer

WenyanZhang-MSFT avatar image
1 Vote"
WenyanZhang-MSFT answered

Hello,
Welcome to our Microsoft Q&A platform!
Sorry for the late response, I check your code and find this is a issue about the APP.Mainyou defined, when the app be re-openned , Main is null in APP class. You could give it a value like the following code.

 public App ()
 {
 Home = new HomePage();
 MainPage = App.Home;
 Main = new MyNavigationPage(new MainPage());
 }

Best Regards,
Wenyan Zhang



If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.