Java tutorial
//package com.java2s; import android.content.Context; import android.widget.Toast; public class Main { private static boolean showToast = true; public static void showLong(Context context, CharSequence message) { if (showToast) Toast.makeText(context, message, Toast.LENGTH_LONG).show(); } public static void showLong(Context context, int message) { if (showToast) Toast.makeText(context, message, Toast.LENGTH_LONG).show(); } public static void show(Context context, CharSequence message, int duration) { if (showToast) Toast.makeText(context, message, duration).show(); } public static void show(Context context, int message, int duration) { if (showToast) Toast.makeText(context, message, duration).show(); } }