Class: Toybox::System::Intent

Inherits:
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.

Examples:

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

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]

See Also:

Since:

  • 2.2.0

App Types:

  • Widget

  • App

  • Audio Content Provider App

  • Background Services

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Lang::Object

equals, hashCode, method, toString, weak

Constructor Details

initialize(aURI, aArgs) ⇒ Intent

Create an Intent.

Parameters:

Since:

  • 2.2.0


11187
11188
# File 'Monkeybrains.rb', line 11187

def initialize(aURI, aArgs)
end

Instance Attribute Details

argumentsObject

Since:

  • 2.2.0


11179
11180
11181
# File 'Monkeybrains.rb', line 11179

def arguments
  @arguments
end

uriObject

Since:

  • 2.2.0


11178
11179
11180
# File 'Monkeybrains.rb', line 11178

def uri
  @uri
end