左晓为主开发手持机充值管理机
zuoxiao
2024-07-29 fc1ec55e6ad56dc92737657750bcca7ed49f53eb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package com.dayu.qiheonlinelibrary.utils;
 
import android.content.Context;
import android.text.TextUtils;
import android.widget.Toast;
 
/**
 * Toast工具类
 */
public class ToastUtil {
 
 
    private static Toast makeText(Context context, CharSequence text, int duration) {
        return Toast.makeText(context, text, duration);
    }
 
    public static void showToastShort(Context context, String s) {
        if (s != null) {
            if (!TextUtils.isEmpty(s))
                makeText(context, s, Toast.LENGTH_SHORT).show();
        }
    }
 
    public static void showToastLong(Context context, String s) {
        if (!TextUtils.isEmpty(s)) {
            makeText(context, s, Toast.LENGTH_LONG).show();
        }
    }
 
    public static void showToast(Context context, String s) {
        if (s != null) {
            makeText(context, s, Toast.LENGTH_LONG).show();
        }
    }
 
    public static void showToast(Context context, int resId) {
        showToastLong(context, context.getString(resId));
    }
 
    public static void showToastShort(Context context, int resId) {
        showToastShort(context, context.getString(resId));
    }
 
    public static void showToastLong(Context context, int resId) {
        showToastLong(context, context.getString(resId));
    }
 
 
}