Java tutorial
//package com.java2s; //License from project: Apache License import android.content.Context; import android.widget.Toast; public class Main { private static Toast toast; private synchronized static void globalToast(Context context, String tip, int duration) { if (toast != null) { toast.setText(tip); toast.setDuration(duration); } else { toast = Toast.makeText(context, tip, duration); } toast.show(); } }