0

我想要一个 android: 中的方法getCallerName()。它将打印使用它的方法的名称。示例:如果我有一个方法:

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

谁能告诉我我可以在运行时做到这一点?我该怎么做?提前致谢!

4

0 回答 0