Java tutorial
//package com.java2s; import android.content.Context; import android.widget.Toast; public class Main { private static Toast mToast; public static void showLongToast(Context context, CharSequence message) { if (context == null) return; if (mToast == null) { mToast = getToastObj(context); } mToast.setText(message); mToast.setDuration(Toast.LENGTH_LONG); mToast.show(); } private static Toast getToastObj(Context context) { return Toast.makeText(context, "", Toast.LENGTH_SHORT); } }