Toast
The Toast object contains functions for displaying toast notifications.
The functionality of this object allows the developer to display system toast notifications within their WebWorks application.Learning Resources:
| Sample - Using Toast Sample that demonstrates how to use the BlackBerry Toast API [BlackBerry on GitHub]. |
Supported Platform(s)
| - BlackBerry 10 |
| API | BB5.0 | BB6.0 | BB7.0 | PB1.0 | PB2.0 | BB10 | Ripple |
|---|---|---|---|---|---|---|---|
| blackberry.ui.toast.show | Y |
Configuration Document Settings
|
To use all of the API described for this object, you must ensure the following settings are in your configuration document: |
|
You must declare the feature element(s) below in your configuration document: |
| Feature ID | BB5.0 | BB6.0 | BB7.0 | PB1.0 | PB2.0 | BB10 | Ripple |
|---|---|---|---|---|---|---|---|
| <feature id="blackberry.ui.toast" /> | Y |
| Permission Elements (PlayBook and BlackBerry 10+) |
|---|
| This API does not require a <permission> element to be declared in the configuration document of your BlackBerry WebWorks Application. |
Functions
| Number | blackberry.ui.toast.show |
Functions
static
Number
blackberry.ui.toast.show
(message : String, [options : Object])
Displays a toast notification.
| Supported Platforms | |
|---|---|
| - BlackBerry 10 | |
| Parameters | |
|---|---|
| message | Message to be displayed in the toast. |
| options |
options object that specifies the buttonText, and callback handlers that should be used by the toast
buttonText: parameter that specifies the label for the button within the toast. buttonCallback: callback for receiving the button event when the user selects the toast button. dismissCallback: callback for receiving an event when the toast dismisses either through the toast's timeout or when the button is selected. timeout: timeout value that can be used to extend the toast for as long as the user desires. The value specified is parsed in milliseconds. |
Return:
A numeric ID to reference this toast by.
Code Example:
|
Documentation generated by JsDoc Toolkit 2.4.0 on Mon Feb 11 2013 14:51:11 GMT-0500 (EST)