View.toast()

Overview

Display a toast message in the current view. A toast message displays briefly, never receives focus, and disappears without user interaction.

Generally, the default amount of time a toast message displays is 2 seconds, or if longDisplay is set to true, it displays for 3.5 seconds. The default length may vary depending on the version of the OS.

Added in version 1.2.109

Format

View.toast(message, longDisplay);

Parameter Description Type Required
message The message to display. String Required
longDisplay Set true if the message should be displayed for 3.5 seconds. Boolean Required

Example

Copy
/* Display a toast message of 'hello'
 */
 
 View.toast('hello', true);