Module: Toybox.ActivityPrompts

Overview

The ActivityPrompts module allows a data field to handle audio output during an activity.

Using this module will cause to all activity prompts during an activity to no longer play through the device or any connected devices such as headphones. The user must select the data field as the activity prompt handler in the device menus.

Prompts will be passed to ActivityPromptDelegate.onPrompt() when they are to be played. If more than one prompt is passed to ActivityPromptDelegate::onPrompt(), they are meant to be played together uninterrupted.

Since:

API Level 5.2.0

App Types and Runtime Contexts:

  • Data Field

  • Glance

Supported Devices:

Requires Permission:

  • ActivityPrompts

Classes Under Namespace

Classes: ActivityPrompt, ActivityPromptDelegate

Typedef Summary collapse

Instance Method Summary collapse

Instance Method Details

registerActivityPromptsListener(delegate as ActivityPrompts.ActivityPromptDelegate, options as Lang.Dictionary or Null) as Lang.Boolean

Register as the activity prompt output provider. true will only be returned only if the data field is the selected activity prompt output provider. If false is returned, ActivityPromptDelegate.onAudioOutputChange() will be called with true if the data field becomes the selected activity prompt output provider.

Parameters:

Returns:

  • Lang.Boolean

    true if the app was registered succesfully, false otherwise

Since:

API Level 5.2.0

setActivityPromptTextLanguage(languages as System.Language) as Lang.Boolean

Set the language for ActivityPrompt.text.

Parameters:

Returns:

  • Lang.Boolean

    true if the language is available and the data field is the current activity prompt output provider, false otherwise.

Since:

API Level 5.2.0

unregisterActivityPromptsListener() as Void

Unregister as the activity prompt output handler. Activity prompt output will return to the default provider if the data field is the current provider.

Since:

API Level 5.2.0


Generated Dec 4, 2025, 10:13:08 AM