Toast is Android provides a very good way to remind, the program can be used in some of her short notice to the user's information, this information will disappear automatically after a period of time,
Example is that in the onCreate () method, to bind a Button click event, then click on the Button, display a message, the code is as follows:
The Button for the=(Button) the findViewById (R.i db utton_1);
For the setOnClickListener (new View. An OnClickListener () {
@ Override
Public void onClick (View v) {
Toast. MakeText (FirstActivity. This, "you clicked the button 1", Toast. LENGTH_SHORT), show ();
}
});
CodePudding user response:
CodePudding user response: