Android Utililty Methods Throwable Method Get

List of utility methods to do Throwable Method Get

Description

The list of methods to do Throwable Method Get are organized into topic(s).

Method

StringgetThrowingMethod(Throwable t)
Returns the class and method name (+a line number) in which the Throwable was thrown.
StackTraceElement[] trace = t.getStackTrace();
StringBuffer sb = new StringBuffer();
if (trace == null || trace.length == 0) {
    sb.append("[Stack trace not available]");
} else {
    sb.append(trace[0].isNativeMethod() ? "native method" : "");
    sb.append(trace[0].getClassName());
    sb.append(".");
...