You can use Thread.currentThread().getStackTrace().
That returns an array of StackTraceElements that represent the current stack trace of a program.
You can use Thread.currentThread().getStackTrace().
That returns an array of StackTraceElements that represent the current stack trace of a program.