Class: Toybox.System.Intent

Inherits:
Toybox.Lang.Object show all

Overview

An Intent sends content from one app to another app.

Strictly speaking, content is sent to a URI by an Intent, which can either be a native activity (e.g. Run, Bike, etc.) or another Connect IQ app. Used in conjunction with System.exitTo(), Intents can exit the current app and launch a second app, passing information from the originating app to the newly open app.

For example, a widget might collect data from a service via a Communications call and pass that data to a device app via Intent for use during an activity.

See Also:

Example:

using Toybox.System;
var targetApp = new System.Intent(
    "manifest-id://12345678-1234-1234-1234-123412341234",
    {"arg"=>"CurrentAppName"}
);
System.exitTo(targetApp);

Example:

Valid Intent URI formats

manifest-id://[manifest ID in the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx]
store-id://[app store ID in the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx]

Since:

API Level 2.2.0

App Types:

  • Watch App

  • Audio Content Provider

  • Widget

Instance Member Summary collapse

Instance Method Summary collapse

Instance Attribute Details

var arguments as Lang.Dictionary or Null

Since:

API Level 2.2.0

var uri as Lang.String

Since:

API Level 2.2.0

Instance Method Details

initialize(aURI as Lang.String, aArgs as Lang.Dictionary or Null)

Constructor

Parameters:

  • aURI(Lang.String)

    The URI that specifies receiver of the Intent

  • aArgs(Lang.Dictionary)

    Parameters to pass to the target URI

Since:

API Level 2.2.0


Generated Apr 17, 2024 9:40:38 AM