Toast工具类

public class ToastUtil {
private static Toast toast = null;
public static void show(String msg){
if (toast == null){
toast = Toast.makeText(MyApp.getContext(), msg, Toast.LENGTH_SHORT);
} else {
toast.setText(msg);
}
toast.show();
}
}

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