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 watch-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

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



9350
9351
# File 'Monkeybrains.rb', line 9350

def initialize(aURI, aArgs)
end

Instance Attribute Details

argumentsObject

Since:

  • 2.2.0



9342
9343
9344
# File 'Monkeybrains.rb', line 9342

def arguments
  @arguments
end

uriObject

Since:

  • 2.2.0



9341
9342
9343
# File 'Monkeybrains.rb', line 9341

def uri
  @uri
end