0

I want a method in android: getCallerName(). It will print the name of the method which use it. Example: if I have a method:

void doSomething(){
    getCallerName(); // This line will print "doSomething"
} 
//or another example
void foo(){
   getCallerName(); // this line will print "foo"
}

Can anyone tell me that I can do that at runtime? And how can I do that? Thanks in advance!

Zach Rattner
  • 20,745
  • 9
  • 59
  • 82
Kingfisher Phuoc
  • 8,052
  • 9
  • 46
  • 86

0 Answers0