Skip to content

Tag: java

How to get method name in android (java)

I want to retrieve the method name on an android app for logging purposes but can’t seem to get it. I’ve already tried doing what was suggested in other answers, such as: Thread.currentThread().getStackTrace(); and new Object(){}.getClass().getEnclosingMethod().getName(); To no avail, the first re…