首页 > 其他 > 详细

简单的工具类LogUtil、Toast

时间:2015-06-04 09:46:49      阅读:156      评论:0      收藏:0      [点我收藏+]

简单的工具类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();
    }
    
}

简单的工具类LogUtil、Toast

原文:http://blog.csdn.net/menglele1314/article/details/46355871

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!