Android / Java: Get the name of method being executed

If you want to trace the name of the method that’s being executed, the Java code snippet in this page might help you.

This is especially handy when you are debugging by tracking every method that is executed. You can enclose these lines of codes in a function that you call in every method — that’s easier than typing the name for each method you’re tracking, right? 🙂

The String variable methodName will contain the name of the method where you place the following lines of code:

Related Posts:

Posts that may be related to "Android / Java: Get the name of method being executed":

Catzie

A Filipino programmer and baker. When I have time to spare, I blog, play video games, watch series (usually anime), cook dishes, draw, or spend a little time with pets. When I have the rare luxury of time, I get to travel and record song covers too! Running small-time online dessert shops Cookies PH and Catzie's Cakery.

Leave a Reply

Your email address will not be published. Required fields are marked *