如何在Android中覆盖ACRA的设置

如何在Android中覆盖ACRA的设置,第1张

概述在我的应用程序类中,我使用这些注释定义了ACRA @ReportsCrashes(formKey = "", mailTo = "[email protected]", mode = ReportingInteractionMode.DIALOG, //resToastText = R.string.crash_toast_text, / 在我的应用程序类中,我使用这些注释定义了ACRA

@ReportsCrashes(formKey = "",mailTo = "[email protected]",mode = ReportingInteractionMode.DIALOG,//resToastText = R.string.crash_toast_text,// optional,displayed as soon as the crash occurs,before collecting data which can take a few seconds            resDialogText = R.string.crash_dialog_text,resDialogIcon = androID.R.drawable.ic_dialog_info,//optional. default is a warning sign            resDialogTitle = R.string.crash_dialog_Title,// optional. default is your application name            resDialogCommentPrompt = R.string.crash_dialog_comment_prompt,// optional. when defined,adds a user text fIEld input with this text resource as a label            resDialogokToast = R.string.crash_dialog_ok_toast // optional. displays a Toast message when the user accepts to send a report.)public class AttachApplication extends Application implements OnSharedPreferencechangelistener{

这工作正常,但我在我的应用程序中有按钮,用户可以手动发送错误报告.为此,我想更改模式,以便只发送一封电子邮件而不是一个Dialog.

public voID startSendErrorAction(VIEw vIEw) {    Log.d( TAG,"sending error to srs" );    ACRAConfiguration config = ACRA.getConfig();    int prevDialogTitle = config.resDialogTitle();    int prevDialogText = config.resDialogText();    config.setResDialogTitle( R.string.manual_error_Title );    config.setResDialogText( R.string.manual_error_text );    ACRA.setConfig( config );    ACRA.getErrorReporter().handleException(null);    config.setResDialogText( prevDialogText );    config.setResDialogTitle( prevDialogTitle );    ACRA.setConfig( config );}

我试图只更改对话框的文本和标题,但这不起作用.它始终使用注释中配置的那些.

是否有可能覆盖这些值?
谢谢

解决方法 我想你想要像 ACRA: sometimes dialog report and other times silent report那样但处于“相反”的方向. 因此,首先在配置中使用SILENT,然后在设置配置之前使用DIALOG重置它. @H_404_33@ 总结

以上是内存溢出为你收集整理的如何在Android中覆盖ACRA的设置全部内容,希望文章能够帮你解决如何在Android中覆盖ACRA的设置所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1124834.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-30
下一篇 2022-05-30

发表评论

登录后才能评论

评论列表(0条)

保存