feat: 新增toast工具类

This commit is contained in:
niushuai233 2022-10-21 16:29:07 +08:00
parent 1c8968e140
commit 2d623297a6

View File

@ -6,6 +6,8 @@ import android.widget.Toast;
public class ToastUtil { public class ToastUtil {
public static void show(Activity activity, String msg) { public static void show(Activity activity, String msg) {
Toast.makeText(activity, msg, Toast.LENGTH_SHORT).show(); Toast toast = Toast.makeText(activity, msg, Toast.LENGTH_SHORT);
toast.setText(msg);
toast.show();
} }
} }