Java tutorial
//package com.java2s; //License from project: Open Source License import android.content.Context; import android.widget.Toast; public class Main { public static void makeToast(Context ctx, String text, boolean length_long) { /* * Run a toast; long / short depending on boolean */ if (length_long) { Toast.makeText(ctx, text, Toast.LENGTH_LONG).show(); } else { Toast.makeText(ctx, text, Toast.LENGTH_SHORT).show(); } } }