Android Exception Log showException(Context parent, Throwable ex)

Here you can find the source of showException(Context parent, Throwable ex)

Description

show Exception

Declaration

public static void showException(Context parent, Throwable ex) 

Method Source Code

//package com.java2s;

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   w w w.  j a va2s .  c o m*/
    }
}

Related

  1. logException(String tag, Throwable ex)