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 toast(String mesg) { if (null != curToast) { curToast.cancel(); } curToast = Toast.makeText(curContext, mesg, Toast.LENGTH_SHORT); curToast.show(); } }