【发布时间】:2015-04-27 16:20:55
【问题描述】:
它适用于 Android 5.0,但不适用于 Jellybean 设备。
@ReportsCrashes(
formKey = "", // This is required for backward compatibility but not used
formUri = "dummyurl",
reportType = org.acra.sender.HttpSender.Type.JSON,
httpMethod = org.acra.sender.HttpSender.Method.PUT,
formUriBasicAuthLogin="adminTest",
formUriBasicAuthPassword="adminTest",
mode = ReportingInteractionMode.TOAST,
resToastText = R.string.crash_toast_text)
public class Application extends Application {
@Override
public void onCreate() {
super.onCreate();
init();
ACRA.init(this);
Thread.setDefaultUncaughtExceptionHandler(sUncaughtExceptionHandler);
}
private UncaughtExceptionHandler sUncaughtExceptionHandler = new UncaughtExceptionHandler() {
@Override
public void uncaughtException(Thread thread, Throwable ex) {
Log.i(LogTag, "uncaughtException: ");
dummyMethod();
Thread.getDefaultUncaughtExceptionHandler().uncaughtException(
thread, ex);
}
};
}
【问题讨论】:
-
我不知道为什么它在 L 中工作,但这里的问题是你设置了两个 UncaughtExceptionHandler 一个你手动分配的,一个 ACRA 正在为你创建,这是不对的。跨度>