In addition to Notification, Toast can also be used to notify the user of an event. Toast is a transparent dialog box that automatically disappears after several seconds of display on the screen. Similar to Tooltip. A feature of Toast does not obtain the screen Focus, which does not affect the running of applications.
NotifyWithText introduces the basic method of using Toast. The time interval of Toast displayed on the screen can be controlled. Show Short Notification and Show Long Notification set two different time intervals. A short message and a long message are displayed.
[Java]
Toast. makeText (policywithtext. this, R. string. short_icationication_text,
Toast. LENGTH_SHORT). show ();
Toast. makeText (policywithtext. this, R. string. long_icationication_text,
Toast. LENGTH_LONG). show ();
Toast. makeText (policywithtext. this, R. string. short_icationication_text,
Toast. LENGTH_SHORT). show ();
Toast. makeText (policywithtext. this, R. string. long_icationication_text,
Toast. LENGTH_LONG). show ();
Author: mapdigit