START_SPINNER - Start an indeterminate spinner for a long-running task

STOP_SPINNER - Stop a running spinner and close the dialog

When to use them

START_SPINNER shows an indeterminate progress spinner indicating a long-running task is underway.

STOP_SPINNER cancels a spinner when the task is complete.

START_SPINNER

Syntax

START_SPINNER [message] 

message required

Message to display while the spinner is active. Messages should be kept short enough to fit on the device display.

A spinner
A spinner

Results

START_SPINNER returns an ID of the spinner as output. You must capture this value to cancel the spinner!

STOP_SPINNER

Syntax

STOP_SPINNER {spinner_id} 

spinner_id

Examples

  __spinnerid=$(START_SPINNER "Thinking")
sleep 5
STOP_SPINNER ${__spinnerid}