我在我的Android應用程序中使用ACRA內。ACRA cound沒有處理異常情況的應用#的onCreate()
但我發現,當異常應用#onCreate()方法中發生,它只能保存報告文件,而不是提高該對話框發送。
這有什麼錯我的代碼?
@ReportsCrashes(formKey="")
public class MyAndroidApplication extends Application
{
public void onCreate()
{
ACRAConfiguration config = ACRA.getConfig();
config.setMailTo("[email protected]");
config.setResToastText(R.string.acra_toast);
config.setResDialogText(R.string.acra_dlg_txt);
config.setResDialogCommentPrompt(R.string.acra_dlg_comment_prpmpt);
try
{
config.setMode(ReportingInteractionMode.DIALOG);
}
catch (ACRAConfigurationException e)
{
logger.error("fail to config ACRA", e);
return;
}
ACRA.setConfig(config);
ACRA.init(this);
someMethodThrowsException();
}
}
代替logger.error,嘗試e.printStackTrace() – njzk2