Android examples for User Interface:Toast
show Error Message via Toast
//package com.java2s; import android.content.Context; import android.widget.Toast; public class Main { public static void showErrorMessage(Context context, Throwable ex) { Toast.makeText(context, ex.getLocalizedMessage(), Toast.LENGTH_LONG) .show();//from w ww .jav a2 s . co m } public static void showErrorMessage(Context context, int message, Object... args) { Toast.makeText(context, context.getString(message, args), Toast.LENGTH_LONG).show(); } }