Toast类

public class ToastUtils {

    private static Toast sToast = null;

    public static void showToast(String msg){
        if(sToast == null){
            sToast = Toast.makeText(XXApplication.getContext(),msg,Toast.LENGTH_SHORT);
        }else{
            sToast.setText(msg);
        }
        sToast.show();
    }

}








你可能感兴趣的:(Android工具类)