Java tutorial
//package com.java2s; import android.content.Context; import android.widget.Toast; public class Main { private static Context sContext; private static Toast sToast; public static void show(int resId) { show(sContext.getString(resId)); } public static void show(String text) { if (sToast == null) { sToast = Toast.makeText(sContext, text, Toast.LENGTH_SHORT); } else { sToast.setText(text); } sToast.show(); } }