Toast is a very convenient prompt message box. It will display a simple prompt message on the program interface, which is used to generate a simple prompt message to the user, it has two features.
1. The Toast prompts that the information will not get the focus,
2. The Toast prompts that the information will automatically disappear after a period of time.
It is also very easy to use Toast to generate the prompt message, as long as the following steps:
1. Call the Toast constructor or the makeText method to create a Toast object.
2. Call the Toast method to set the alignment, margin, and display content of the message.
3. Call the show () method of Toast to display it.
Public void sendMessage (View view) {// Do something in response to button Toast toast = Toast. makeText (MainActivity. this, "simple prompt information", Toast. LENGTH_SHORT); toast. show ();}