Java tutorial
//package com.java2s; //License from project: Open Source License import android.content.Context; import android.widget.Toast; public class Main { private static Toast curToast = null; private static Context curContext = null; static final void toastLong(String mesg) { if (null != curToast) { curToast.cancel(); } curToast = Toast.makeText(curContext, mesg, Toast.LENGTH_LONG); curToast.show(); } }