Java tutorial
//package com.java2s; import android.content.Context; import android.text.TextUtils; import android.widget.Toast; public class Main { /** * showToast * @param context * @param message * @param duration LENGTH_SHORT,LENGTH_LONG */ public static void showToastTips(Context context, String message, int duration) { if (!TextUtils.isEmpty(message)) { Toast.makeText(context, message, Toast.LENGTH_SHORT).show(); } } }