Java tutorial
//package com.java2s; import android.content.Context; import android.widget.Toast; public class Main { private static Toast sToast; /** * show a toast * @param context * @param resId the content that to be display */ public static void getToast(Context context, int resId) { if (null == sToast) { sToast = Toast.makeText(context, resId, Toast.LENGTH_SHORT); } sToast.setText(resId); sToast.show(); } }