Your experience on this site will be improved by allowing cookies
To display information for a short duration, Android Toast can be used. A message needs to be displayed quickly and to disappear after some time is included in a toast
To show notification for a particular interval of time which disappears after some time, the Toast class is used.
The Toast class has only 2 constants:
Constant | Uses |
public static final int LENGTH_LONG | To display the view for a long duration of time. |
public static final int LENGTH_SHORT | To display the view for a short duration of time. |
Code to display the toast:
File: activity_main.xml
0 comments