Android examples for android.app:AlertDialog
show Exception in AlertDialog
import android.app.AlertDialog; import android.content.Context; import android.util.Log; public class Main { public static void showException(Context parent, Throwable ex) { if (ex != null) { Log.e(parent.getClass().getSimpleName(), ex.getLocalizedMessage(), ex); new AlertDialog.Builder(parent).setTitle("Error").setMessage(ex.getLocalizedMessage()) .setNeutralButton("Close", null).show(); }//from www .ja v a 2 s.com } }