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 with a variety of interests such as baking, singing, making up silly song/rap lyrics, K-pop, drawing, creating unique dessert flavors, obsessing about finding out how some things works, board games, anime, video games, and forgetting things that usually go in her long list of interests. 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 *