Android Toast Example

Android Toast Example

Toasts are transient Dialog boxes that remain visible for only a few seconds before fading out .

You can make toast by using Toast class .

The Toast class includes a static makeText method that creates a standard Toast display window. pass the following parameter to this methods 1) Application Context . 2) The text message to display 3) The length of time to display it (LENGTH_SHORTor LENGTH_LONG) .

Once a Toast has been created,display it by calling show.

Customized Toast

You can also customize the toast by setting its display position and assigning it alternative Views or layouts.