

This method can be used to set horizontal and vertical margin

Public void setMargin(float horizontal, float vertical) This method makes the Toast widget with the specified text and for the specified duration. Public static Toast makeText(Context context, CharSequence text, int duration)

Methods of Toast classįollowing are the methods available in the Toast class, which are used to create a Toast. The constant LENGTH_LONG sets a display duration of 3.5 sec while the constant LENGTH_SHORT sets a display duration of 2 sec for the Toast. This can be used to display the Toast for a longer duration.
