Toast is the most commonly used but now many of the procedures in the market do not notice a point, is the toast immediate shutdown problem
Toast played a role in prompting the cancellation should be canceled as soon as possible
User cannot manually cancel toast is a bit annoying.
Actually, it's very, very simple to close.
Add the following code to the tool class:
Package Com.xmic.moman;
Import Android.content.Context;
Import Android.widget.Toast;
public class Myutil {
private static Toast mtoast;
public static void Showtoast (context, int resid, int duration) {
Showtoast (context, context.getstring (RESID) , duration);
}
public static void Showtoast (context context, String msg, int duration) {
if (Mtoast = null) {
mtoast = Toast.mak EText (Context, msg, duration);
else {
mtoast.settext (msg);
}
Mtoast.show ();
}
Call Myutils.showtoast (Context, MSG, duration) when you want to use it;
Perfect Toast Fast Switch