Controlling suspending, resuming and starting Windows Phone Apps with Windows RT, there are 3 events: OnLaunching -> OnLaunched respectively OnSuspending OnResuming
Normally if an app launches, OnLaunching is fired. When the app suspends e.g. the screen saver comes up, OnSuspending is fired. If I go back to the app by opening task list, OnResuming is fired.
Now I have the following problem.
If I switch to another app or the screen saver appears, OnSuspending is fired - this is OK. But if I go back to my app via task list after about 15-20 minutes, the OnLaunching event is fired instead of OnResuming, although my app appears still in the task list.
It's like the app is newly started !
This happens since I redesigned the app in Windows 8.1 RT. In the earlier version of my app, which was running in Silverlight, this worked fine. Whenever I went back to my app via task list, OnResuming was fired.
Doing some tests, I found out the following: Launching an app, the previous execution state can be read from the ActivateEventArgs. So I read them out to see, what application status was before launching. After starting the app the first time, its state is 'notRunning'. If I close the app and reopen it, the state is 'closedByUser'. If the app has been suspended and I revoke it after 15-20 minutes, the state is 'terminated'.
However, the state 'terminated' means, the windows has been closed the app.
Why does windows close my app already after 15-20 minutes and why the app is still in the task list if it has been closed ?
Do you have an idea, what the problem is ?