Dela via


UserActivity.TryParseFromJson(String) Method

Definition

Constructs a UserActivity from a JSON string.

public:
 static UserActivity ^ TryParseFromJson(Platform::String ^ json);
 static UserActivity TryParseFromJson(winrt::hstring const& json);
public static UserActivity TryParseFromJson(string json);
function tryParseFromJson(json)
Public Shared Function TryParseFromJson (json As String) As UserActivity

Parameters

json
String

Platform::String

winrt::hstring

The JSON string that represents the UserActivity.

Returns

A UserActivity constructed from the JSON string.

Windows requirements

Device family
Windows 10, version 1803 (introduced in 10.0.17134.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v6.0)

Remarks

The UserActivity APIs allow an application to provide rich information for Cortana Pick-up Where I Left Off and the Timeline. A better re-engagement UI can be built within the consuming application if the source application can provide more details about the re-engagement. This method creates a UserActivity from information stored in a JSON string that a source application provided so that the consuming application can get information about the source application, and the specific activity within the source application.

Applies to

See also