Example usage for Java android.widget Toast fields, constructors, methods, implement or subclass
The text is from its open source code.
int | LENGTH_SHORT Show the view or text notification for a short period of time. |
int | LENGTH_LONG Show the view or text notification for a long period of time. |
Toast(Context context) Construct an empty Toast object. |
void | cancel() Close the view if it's showing, or don't show it if it isn't showing yet. |
int | getGravity() Get the location at which the notification should appear on the screen. |
View | getView() Return the view. |
int | getXOffset() Return the X offset in pixels to apply to the gravity's location. |
int | getYOffset() Return the Y offset in pixels to apply to the gravity's location. |
Toast | makeText(Context context, CharSequence text, @Duration int duration) Make a standard toast that just contains a text view. |
Toast | makeText(Context context, @StringRes int resId, @Duration int duration) Make a standard toast that just contains a text view with the text from a resource. |
void | setDuration(@Duration int duration) Set how long to show the view for. |
void | setGravity(int gravity, int xOffset, int yOffset) Set the location at which the notification should appear on the screen. |
void | setText(@StringRes int resId) Update the text in a Toast that was previously created using one of the makeText() methods. |
void | setText(CharSequence s) Update the text in a Toast that was previously created using one of the makeText() methods. |
void | setView(View view) Set the view to show. |
void | show() Show the view for the specified duration. |