Java tutorial
//package com.java2s; import android.content.Context; import android.util.Log; import android.widget.Toast; public class Main { /** * This method provides uniform logging functionality for given message * @param context * @param errmsg */ public static void handleError(Context context, String errmsg) { Toast.makeText(context, errmsg, Toast.LENGTH_LONG).show(); Log.e("Yum Exception!", errmsg); } }