njsokalski avatar image
0 Votes"
njsokalski asked RoyLi-MSFT commented

UWP App Locks After Returning From Other Apps

When a user leaves my app (not closes, just leaves, triggering the EnteredBackground event), does something in another app, and then returns (triggering the LeavingBackground event), I receive an InvalidOperationException and my app locks up. The app no longer responds to click, touch, etc., and it does not let me close it. I am forced to open Task Manager to close the app. I am not sure specifically what is causing the InvalidOperationException, so I am not sure how to determine the details. I handle OnSuspending & override OnLaunched to save & restore state, but what should I do to allow the user to leave and return to my app without causing it to lock up? Thanks.

· 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.

What have you done in the LeavingBackground event? If you haven't do anything in the LeavingBackground event, could you please tell me what have you done in OnSuspending event? You could share some code here. It will be better if you could share a sample that could reproduce this issue.

0 Votes 0 ·

I have not done anything in the LeavingBackground event (I just know that is the last event I am able to detect before the lockup), and in the OnSuspending event I just do some basic state saving.

0 Votes 0 ·

Could you please share the a sample that could reproduce the issue here?

0 Votes 0 ·

Are there any updates about this issue?

0 Votes 0 ·

0 Answers