简体   繁体   中英

Launching windows metro app from secondary pinned tile

I am developing windows metro app using xaml/C#. I have following functions for handling app states in App.xaml.cs file :

 public overide OnLaunching();  
 public OnSuspending();  
 public OnResuming();

I have pinned some app content as secondary tile. First I launch my app.Then I put it in background When the launched app goes in suspended state, I click the pinned tile , I am not sure which of OnResuming or onLaunching should be invoked in that case ?

Here is a clear documentation about application lifecycle: Application lifecycle (Windows Store apps) . If your app will be in background, it will be Resumed , if not - Launched . It's easy to check.

An app is launched whenever it is activated by the user but the process is in the NotRunning state, because it was just deployed, it crashed, or it was suspended but could not be kept in memory.

It also depends on the time, how long your app was in background. Windows Store app have a grace period about 10 seconds, when your app will be kept in memory without suspension.

You should check the PreviousExecutionState property to be sure what happened.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM