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!