【发布时间】:2011-07-27 16:06:03
【问题描述】:
大家好,我想在一个中心位置处理我的 android 应用程序中的所有异常,即应用程序类
我的应用程序类中有如下方法:
public void HandleException(Exception e)
{
String appName = getString(R.string.app_name);
String className = ""; // magic method to find out the original class name where the exception occurred
String methodName = ""; // magic method to find out the original method name where the exception occurred
Log.e(appName, className + " : " + methodName + " - " + e.getMessage());
}
现在缺少的只是神奇的方法,它使用发生异常的原始类和方法填充我的 className 和 methodName 变量
谁能帮忙
提前谢谢...
【问题讨论】:
标签: java android logging exception-handling