Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resuming app on Windows Phone 10 display infinite "please wait" ring #397

Closed
vRITHNER opened this issue Dec 8, 2015 · 21 comments
Closed

Comments

@vRITHNER
Copy link

vRITHNER commented Dec 8, 2015

Hi,
I was thinking this issue was in our code, but I just deploy the "Mimimal" template to both my Lumia 1520 and also a Lumia 950 both running latest WP10 insider preview version.
To repro it,
-just launch once the app.
-Press "Home"
-launch again the app.
the app just not display a white page containing the splash screen with a "please wait" ring running forever.
I have recorded with my web cam 2 videos (1 with minimal template and 1 with our apps doing same issue); both are copied in our OneDrive: http://1drv.ms/1YVpFY3
This is a show stopper for us
Thanks for any help
-Vince

@keneniah
Copy link

keneniah commented Dec 9, 2015

You will have to wait for version 1.0.9. In that version the issue is fixed. Otherwise you can download it here from GitHub and build it yourself.

@vRITHNER
Copy link
Author

vRITHNER commented Dec 9, 2015

I just downloaded the latest source and added as libs rather than nuget in our project but this changes nothing. It works mabe 1 or 2 times in a row (means app resume correctly) but then the splashscreen opens forever...

@vRITHNER
Copy link
Author

vRITHNER commented Dec 9, 2015

We saw also another issue concerning the resuming of apps on the phone. On resume, apps restart on the first page like if it was not a resume. it should resume on last opened page like the way works with standard universal app template. This is not only in our project. I just tested with T10 BottomAppBar and Minimal sample; they both resume on start page.

@keneniah
Copy link

You're absolutely right. The app is always resuming on the start page and not on the last opened page and I also see the splashscreen forever after a few tries. Seems like the bug hasn't been fixed yet. I didn't notice that at first look. Hopefully someone can look into this...

@keneniah
Copy link

And the big problem is that this never happens in debug mode. When the device is connected and I run the application I can suspend and resume as often as I want, everything works just fine. When I unplug the cable the splash screen stays forever when I navigate to a page, suspend the app and resume it again.

@9kon
Copy link

9kon commented Dec 11, 2015

Yes it is still happening..
looking that output when having the app deployed as release on a device gives the following exceptions for me when i try to return to the app using the icon.

Exception thrown: 'System.Threading.Tasks.TaskCanceledException' in System.Private.Threading.dll
Exception thrown: 'System.Threading.Tasks.TaskCanceledException' in System.Private.CoreLib.dll
Exception thrown: 'System.Threading.Tasks.TaskCanceledException' in System.Private.CoreLib.dll

@9kon
Copy link

9kon commented Dec 11, 2015

I tried adding

if (exception is TaskCanceledException)
{
e.Handled = true;
return;
}

To my void App_UnhandledException(object sender, UnhandledExceptionEventArgs e)
This fixes the problem for me, but is not really a solution.. :-)

@calloncampbell
Copy link
Contributor

I'm also seeing this issue on Win10 Mobile and on occasion Win10 Desktop.

@JerryNixon
Copy link
Member

Any @Windows-XAML/contributors have any help on this one?

@JerryNixon JerryNixon added the bug label Dec 16, 2015
@JerryNixon JerryNixon added this to the NuGet Library v1.0.9 milestone Dec 16, 2015
@darenm
Copy link
Contributor

darenm commented Dec 16, 2015

So I have noticed some quirks coding on Windows 10 mobile especially with fast resume, etc. I'm working on shipping an app right now (not based on T10) - once I get that out of the door I'll see if I can track down the glitches with Mobile.

@chosenonehacks
Copy link

Add this two methods to your app.xaml.cs, and it should help, remove them when 1.0.9 will hit release.

public static void ClearNavigationServices(Window window)
        {
            var wrapperToRemove = WindowWrapper.ActiveWrappers.FirstOrDefault(wrapper => object.ReferenceEquals(wrapper.Window, window));
            if (wrapperToRemove != null)
            {
                wrapperToRemove.NavigationServices.Clear();
            }
        }

        public override Task OnSuspendingAsync(object s, SuspendingEventArgs e)
        {
            if (Windows.System.Profile.AnalyticsInfo.VersionInfo.DeviceFamily.Equals("Windows.Mobile"))
            {
                ClearNavigationServices(Window.Current);
            }
            return base.OnSuspendingAsync(s, e);
        }

@DominikErnst
Copy link

Thank you xorch ... made my day!

@JerryNixon
Copy link
Member

I think this solution makes Resume not work anymore, right?

@JerryNixon
Copy link
Member

@xorch, in the current code base I have removed WindowWrapper.ClearNavServices() which might be what you are relying on in your comment above. Could you help me understand the issue here?

@bc3tech
Copy link
Contributor

bc3tech commented Jan 9, 2016

note the relationship between the fix here and #457

@luiscantero
Copy link
Contributor

I've been doing some tests trying to fix this and so far this seems to work also when resuming (tested only on Desktop):
public override async Task OnStartAsync(StartKind startKind, IActivatedEventArgs args)
{
// navigate to first page
var nav = WindowWrapper.ActiveWrappers.FirstOrDefault(wrapper => object.ReferenceEquals(wrapper.Window, Window.Current)).NavigationServices;
if (nav.Count > 1)
{
nav.Remove(nav[0]);
}

        NavigationService.Navigate(typeof(Views.MainPage));
        await Task.CompletedTask;
    }

@bc3tech
Copy link
Contributor

bc3tech commented Jan 10, 2016

What's the functional difference between this and the Clear logic in place today?

@luiscantero
Copy link
Contributor

The clear logic doesn't let you resume to a page other than main (e.g. after being suspended in tablet mode). The logic that I posted lets you resume and also start new.

@bc3tech
Copy link
Contributor

bc3tech commented Jan 11, 2016

gotchya. how does it work on mobile?

@luiscantero
Copy link
Contributor

I've only tested in using the mobile emulator (10586) and it behaves exactly as the desktop. To elaborate some more on what I ment by "it doesn't let you resume" if you use "Clear()":

  • Let's say you have an app called ABC with 3 pages: Main, Categories and Products.
  • In tablet mode, you navigate from Main to Categories and from there to Products and back again.
  • Next, you switch to another app XYZ to put ABC in suspended state.
  • When you return to ABC (e.g. using Alt or Windows + Tab), it resumes on Categories, but from there you cannot navigate to Products or anywhere else anymore because the navigation service has been cleared.

If you use my snippet, you can resume on Main, Categories or Products or even restart the app though the tile icon (even while being suspended) and everything behaves as expected.

@JerryNixon
Copy link
Member

Resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants