Open top menu

                             
                                             Android Toast Example 

               
 Toast notify the user about an operation without expecting any input. Toast provided the  small popup take few seconds and automatically fade out.

For example,  The Toast notify the click on button "press a left button",  show after click on button, popup 

in same activity .
Instantiate a android.widget.Toast object   using  static  makeText();     method. this method take a three parameters  application  Context,  the  text  message, and  the  duration  for  the Toast.
Toast notification  by calling  show (); method.


//display in short period of time
Toast.makeText(getApplicationContext(), "press a left button",
                      Toast.LENGTH_SHORT).show();
 String data="press a left button";
//display data value
Toast.makeText(getApplicationContext(), data,
                        Toast.LENGTH_SHORT).show(); 
Tagged

0 comments