Java tutorial
//package com.java2s; //License from project: Open Source License import android.content.Context; import android.widget.Toast; public class Main { /** * Display a short toast * @param context to use * @param id of the string resource */ public static void toast(Context context, int id) { Toast toast = Toast.makeText(context, context.getString(id), Toast.LENGTH_SHORT); toast.show(); } }