Java tutorial
//package com.java2s; import android.content.Context; import android.widget.Toast; public class Main { private static Toast toast; public static void showTextShort(Context context, String text) { if (toast == null) { toast = Toast.makeText(context, text, Toast.LENGTH_SHORT); } else { toast.setText(text); toast.setDuration(Toast.LENGTH_SHORT); } toast.show(); } }