简单的工具LogUtil、Toast

it2025-07-27  6

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

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

转载于:https://www.cnblogs.com/bhlsheji/p/4847756.html

最新回复(0)