Toast.maketext (This, "content", Toast.length_short). Show ();
Show a toast directly, the third argument is the length of time, and a toast.length_long that represents a long time
This toast can still be set to a location, however, to require an object
Public void Toast (String m) { = Toast.maketext (This, "M", Toast.length_short); Mtos.setgravity (Gravity.center,0,0); }
Create a new Toast object, call the static method Toast.maketext () method, assign the value to MTOs, and then, by calling the Setgravity () method call, the main parameter of this method is the first one, Gravity.center is set in the center display, there are other parameters such as Gravity.vercital_center and so on, the English name should be very obvious, here is not much to say, directly by calling the automatic prompt selection on the line!
PS: In general, the toast is defined in a method, in which a string parameter is defined, and then it needs to be used, just call the method and pass in the characters that need to be displayed as arguments.
Android Development--toast Knowledge