Tuesday, February 11, 2014

About Toast


            
This information is displayed when the operation is relatively fast, which shows clearly lagging behind.

Can be set in the new information, and clear information is displayed in front of yet?

Reply:
You can set the length of time the display
Reply:
android does not provide revocation of Toast Toast thread method, you can customize Toast to achieve.
Reply:
Set a time and that place can be a
Reply:
Try toast.lengthshort
Reply:
Set the length of time it yourself
Reply:
cited landlord vnking reply:
This information is displayed when the operation is relatively fast, which shows clearly lagging behind.

Can be set in the new information, and clear information is displayed in front of yet?


Delay gnaw it worse?
Reply:
With a custom alertdialog
Reply:
Toast last parameter is in milliseconds, you can figure it out
Reply:
The last parameter is not a millisecond toast meaning of it, it has only two fixed options, you can also set up another big displays so long, if you want to display the current toast toast when clearly displayed in front of yet, it seems that you can use a cancel method, you can try
Reply:
Very simple, do not use a static object using Toast on the line, set the display information for each show will be displayed before the finish did not disappear
if (null == toast) {
toast = Toast.makeText (context, info, duration);
}
toast.setText (info);
toast.show ();
Reply:
mark it, try upstairs.
Reply:
reference to the 10th floor wangduanqing5945 reply:
very simple, do not use a static object using Toast on the line, each time the display is set to display information, not previously After the display will disappear
if (null == toast) {
toast = Toast.makeText (context, info, duration);
}
toast.setText (info);
toast.show ();


This can try another custom dialog can also be
Reply:
Use only global static variable job management

No comments:

Post a Comment