Android examples for User Interface:Toast
show Exception using Toast
//package com.java2s; import android.app.Activity; import android.util.Log; import android.widget.Toast; public class Main { private static final String TAG = "ActivityUtil"; public static void showException(Activity activity, String msg, Throwable e) {/*from w ww.jav a 2 s . com*/ e.printStackTrace(); String s = String.format("%s: %s", msg, e.getMessage()); showToast(activity, s); Log.e(TAG, s); } public static void showToast(Activity activity, String msg) { String s = String.format("animator: %s", msg); Toast.makeText(activity, s, Toast.LENGTH_LONG).show(); } }