sunjinbo
sunjinbo

Reputation: 2187

Why the OnSuspending event was not called on my WP8.1 Store app?

I created a very simple WP8.1 Store app, and tried an experiment to click no matter Win-Key or Back-Key to make the app to background, but OnSuspending event was not called at all.

I am very curious about what is the state of the current appplication? Running or Suspeded? Why the OnSuspending event was not called? It is not match with MSDN said at: https://msdn.microsoft.com/en-US/library/windows/apps/hh464925.aspx

Upvotes: 3

Views: 510

Answers (1)

Rob Caplan - MSFT
Rob Caplan - MSFT

Reputation: 21899

Visual Studio disables the Windows Runtime's Process Lifetime Management (PLM) when debugging the app so PLM and breakpoints don't interfere with each other. Since the app won't suspend naturally, Visual Studio provides suspend and resume buttons to mimic the process. See How to trigger suspend, resume, and background events for Windows Store apps in Visual Studio

Upvotes: 5

Related Questions