zoukankan      html  css  js  c++  java
  • 简单的工具LogUtil、Toast

    简单的工具LogUtil、Toast     能够用了

    import android.content.Context;

    import android.util.Log;
    import android.widget.Toast;

    public class LogUtil {

        public static void e(String tag, String msg) {
            if (tag == null || msg == null) {
                return;
            }
            Log.e(tag, msg);
        }

        public static void w(String tag, String msg) {
            if (tag == null || msg == null) {
                return;
            }
            Log.w(tag, msg);
        }

        public static void i(String tag, String msg) {
            if (tag == null || msg == null) {
                return;
            }
            Log.i(tag, msg);
        }

        public static void d(String tag, String msg) {
            if (tag == null || msg == null) {
                return;
            }
            Log.d(tag, msg);
        }
        
        public static void show(Context context, String str) {
            Toast.makeText(context, str, Toast.LENGTH_SHORT).show();
        }
        
    }

    版权声明:本文博主原创文章,博客,未经同意不得转载。

  • 相关阅读:
    springboot 路由 json
    mybatis-plus 条件构造器 Wrapper
    mybatis-plus 逻辑删除
    mybatis-plus 分页查询
    mybatis-plus 乐观锁
    mybatis-plus 自动填充处理
    mybatis-plus 增删改查(普通)
    mybatis-plus 日志
    mybatis-plus 初识
    React项目如何打包发布及遇到的坑
  • 原文地址:https://www.cnblogs.com/bhlsheji/p/4847756.html
Copyright © 2011-2022 走看看