Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在android(java)中运行时获取函数名_Java_Android_Runtime - Fatal编程技术网

在android(java)中运行时获取函数名

在android(java)中运行时获取函数名,java,android,runtime,Java,Android,Runtime,我想要一个android中的方法:getCallerName()。它将打印使用它的方法的名称。示例:如果我有一个方法: void doSomething(){ getCallerName(); // This line will print "doSomething" } //or another example void foo(){ getCallerName(); // this line will print "foo" } 有人能告诉我我可以在运行时这样做吗?我该怎么

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

void doSomething(){
    getCallerName(); // This line will print "doSomething"
} 
//or another example
void foo(){
   getCallerName(); // this line will print "foo"
}
有人能告诉我我可以在运行时这样做吗?我该怎么做?提前谢谢

请参阅:您正在调用的函数在Java中称为方法。。。