Nov 28, 2010

Toast: show a little message for the user

The simplest form to make a standard toast that just contains a text view, and show it for the specified duration.

Toast.makeText(HelloWorld.this, "I'm a Toast!", Toast.LENGTH_LONG).show();

Context context - The context to use. Usually your Application or Activity object.
CharSequence text - The text to show. Can be formatted text.
int duration - How long to display the message. Either LENGTH_SHORT or LENGTH_LONG

No comments:

Post a Comment

Infolinks In Text Ads