ActivatedOperation.getDeferral method

Applies to Windows and Windows Phone

Requests that the completion of app activation be delayed.

Syntax


var activatedDeferral = activatedOperation.getDeferral();

Parameters

This method has no parameters.

Return value

Type: ActivatedDeferral

The activation deferral object.

Remarks

When an app starts, the system displays its splash screen until the app indicates that it is ready to display its UI by returning from its activation handler. The app has several seconds to set up its state and initial UI. The UI for the app is displayed to the user when the app returns from its activation handler. However, some apps need to start asynchronous operations to retrieve state information and set up their UI (like using fragment loading to display app pages). Apps that must complete activation asynchronously can get a deferral object from the activation event arguments. This object enables the app to complete activation outside its handler. When the app acquires the deferral object, its activation is not completed when the activation handler returns.

An app can complete activation after its required asynchronous operations complete and it is ready to display its UI. App activation is delayed until the app calls the ActivatedDeferral.complete method.

Requesting a deferral enables an app to display its static splash screen for up to 15 seconds. If the app hasn't completed activation after 15 seconds, the system considers the app hung and will terminate it if the user navigates away from the splash screen.

Note that in normal circumstances and app should take no more than a few seconds to finish activation. If your app requires more than 3 or 4 seconds to restore state and prepare its UI, then you should finish activation and display an extended splash screen screen until your app is ready.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.WebUI

Metadata

Windows.winmd

See also

Tasks
How to handle app activation
How to extend the splash screen
Reference
ActivatedDeferral
ActivatedOperation
Samples
App activated, resume, and suspend using the WRL sample

 

 

Show:
© 2014 Microsoft