【发布时间】:2012-10-08 08:33:33
【问题描述】:
我正在使用 ACRA(Android 应用程序崩溃报告)在发生未处理的异常时发送数据。
openFileOutput() 等方法要求我尝试捕获 iOExceptions。由于异常位于 try catch 块中,因此不会触发 ARCA。但是我仍然想接收并查看堆栈跟踪。有什么方法可以实现吗?
【问题讨论】:
标签: android exception report try-catch
我正在使用 ACRA(Android 应用程序崩溃报告)在发生未处理的异常时发送数据。
openFileOutput() 等方法要求我尝试捕获 iOExceptions。由于异常位于 try catch 块中,因此不会触发 ARCA。但是我仍然想接收并查看堆栈跟踪。有什么方法可以实现吗?
【问题讨论】:
标签: android exception report try-catch
如果处理 IOException 等没有真正意义(即,您真的无能为力),请将其包裹在 RuntimeException 中并扔掉。 ACRA 将捕获并报告此情况。如果你不想让应用崩溃,抓住并处理它,然后使用handleException()手动发送报告:
ACRA.getErrorReporter().handleException(caughtException);
更多详情here
【讨论】: