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 s_toast = null; public static void toast(Context c, String msg) { if (s_toast != null) { s_toast.cancel(); } s_toast = Toast.makeText(c, msg, Toast.LENGTH_SHORT); s_toast.show(); } }