Template10: Relaunching suspended app on W10 Mobile shows blank page. Bug?

Created on 24 Oct 2016  路  9Comments  路  Source: Windows-XAML/Template10

T10 1.1.12. I found on Lumia 930 that there is problem with activation of suspended app. App starts normally, but when I exit from app using Back buton (several times) or Start button and relaunch/activate app - MainPage does dot appear and only empty screen with hamburger menu is visible. It seems that navigation to the main page is not performing in this case. The problem is not present when the app is terminated before relaunching. It applies to device and emulator. My current solution is explicit termination of W10 Mobile app when HardwareButton.Back is pressed and NavigationService.CanGoBack is false... It`s ugly but works... is it bug?

Most helpful comment

I have answered this question in #325 (also relates to #1286). I'll reproduce it here.

The blank page issue as described in #1286 and above:

Please check in your CreateRootElement override (in App.xaml.cs) the NavigationServiceFactory uses ExistingContent.Include and NOT ExistingContent.Exclude as follows:

var service = NavigationServiceFactory(BackButton.Attach, ExistingContent.Include);

All 9 comments

I am also seeing the same issue, once upgraded from 1.1.11 to 1.1.12. its consistently reproducible.

Launch the app and put it in background and then re-launch from the app list and it shows the blank page. I remember seeing same behavior before and there was code hack to reset the app and direct and restore app state when it relauched from the app list.. However, now it does not fire any app launch related events to restore. @JerryNixon , @marcinmarkiewicz .. could you please let us know what can be done here to avoid it. I am thinking i have to roll it back to the older version mean while

this ticket is same as this one #325 i remember the hack mentioned in that ticket worked. However, in this new issue the events which are overridable like app Initialize, launch, resume and all the are not being fired when this happens... not even the shell constructor is being fired.. hence nothing can be done to fix it.. @JerryNixon @SergioMorchon any thoughts why these events are not fired when the app is relaunched.

also noticed once this happens.. you can click on home button and it loads the page fine. However, the back button goes away forever.. no matter how many pages you open .. the back button does not show up on desktop

Hi @JerryNixon any updates on this bug so far ?

@marcinmarkiewicz @JerryNixon any update on the above issue.. it is still showing blank page if you relaunch the app when it is in background

I can confirm this on Lumia 640

I have answered this question in #325 (also relates to #1286). I'll reproduce it here.

The blank page issue as described in #1286 and above:

Please check in your CreateRootElement override (in App.xaml.cs) the NavigationServiceFactory uses ExistingContent.Include and NOT ExistingContent.Exclude as follows:

var service = NavigationServiceFactory(BackButton.Attach, ExistingContent.Include);

Thanks dg2k - I just encountered this problem (on mobile platform only) and the change from Exclude to Include fixed it. Also I didn't catch it during testing because the problem did not occur when I used the mobile emulator (only a real device)

@dg2k
Still didn't work. Reproducible steps as the following:

  1. Create Hamburger project in visual studio.
    1

  2. Edit this line in App.cs

var service = NavigationServiceFactory(BackButton.Attach, ExistingContent.Include);

  1. Switch apps then switch back by trying to reopen the application from it's tile. The app navigates to an empty frame that has just the hamburger menu on it (regardless of what page it was on when I switched away)

The Template10 version see the following screenshot:
1

Changing to Include worked also for me. Before that I was using this (bad) temporary workaround in Shell.xaml.cs:

        protected override void OnGotFocus(RoutedEventArgs e)
        {
            if (MyHamburgerMenu.NavigationService.CurrentPageType == null)
            {
                MyHamburgerMenu.NavigationService.Navigate(typeof(MainPage));
            }

            base.OnGotFocus(e);
        }
Was this page helpful?
0 / 5 - 0 ratings