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