简体   繁体   English

防止Toast处理已处理的异常ACRA

[英]Prevent Toast on handled exceptions ACRA

i am using ACRA for error reporting and everything seems to be fine. 我使用ACRA进行错误报告,一切似乎都很好。 i want to send report of handled exceptions as well so i am using 我也想发送已处理异常的报告,所以我正在使用

ACRA.getErrorReporter().handleException(e);

but don't want the Toast to appear on the handled exceptions . 但是希望Toast出现在处理的异常上 but want toast on unhandled exceptions! 但是想为未处理的异常敬酒! so is there any way to specify this condition? 所以有什么办法可以指定这个条件?

EDIT 编辑

@ReportsCrashes(
        httpMethod = HttpSender.Method.POST,
        reportType= HttpSender.Type.JSON,
        formUri = MFRestConstants.CREATE_ACRA_REPORT,
        mode = ReportingInteractionMode.TOAST,
        resToastText = R.string.msg_toast_text,
        additionalSharedPreferences={"MutterflyAppPref"}
)

There is a method called handleSilentException . 有一个称为handleSilentException的方法。

Usage: ACRA.getErrorReporter().handleSilentException(e); 用法: ACRA.getErrorReporter().handleSilentException(e);

Although I haven't used ACRA before but it is obvious that your mode is set to 尽管我以前没有使用过ACRA,但很明显,您的模式已设置为

mode = ReportingInteractionMode.TOAST

This should display a Toast shouldn't it? 这应该显示一个吐司吗?

You should simply remove that line because you don't want to notify the user I guess !! 您只需要删除该行,因为您不想通知用户我猜!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM