Tost Tool class Management:
1 Packagecom.gzcivil.utils;2 3 ImportAndroid.content.Context;4 ImportAndroid.widget.Toast;5 6 /**7 * 8 * @authorLijinlun Date 2016-01-109 */Ten Public classMytoast { One Private StaticToast Mtoast =NULL; A - /* - * One activity can be displayed multiple times but if Mtoast has been shown then just change the content without waiting for the last hide to show again the */ - Public Static voidShowtoast (Context mcontext, String text,intduration) { - - if(Mtoast! =NULL) + mtoast.settext (text); - Else +Mtoast =Toast.maketext (Mcontext, text, duration); A mtoast.show (); at } - - Public Static voidShowtoast (Context Mcontext,intAresid,intduration) { - - if(Mtoast! =NULL) - Mtoast.settext (ARESID); in Else -Mtoast =Toast.maketext (Mcontext, Aresid, duration); to mtoast.show (); + } -}
Android Development Tost Tool class management (i)