ACRA: sometimes dialog report and other times silent report

自古美人都是妖i 提交于 2020-01-07 02:45:34

问题


What I want to do:

Get feedback on my Android app from within the app itself.

What I've done:

I've just integrated the latest version of ACRA (4.4) to my Android App.

It has silent reports on crashes as the default behaviour

What I want help with:

All I want to do is use the dialog report when I press a Feedback button on my app.


回答1:


I don't know exactly what you want to achieve with your feedback button, but perhaps something like this?

For the configuration of the dialog look at https://github.com/ACRA/acra/wiki/AdvancedUsage#wiki-Dialog. The configuration could also be done in code in the ACRAConfiguration object if you do not want all this in your annotation.

You can then temporarily change the Reporting mode by using:

ACRAConfiguration config = ACRA.getConfig();
config.setMode(ReportingInteractionMode.DIALOG);
ACRA.setConfig(config);
doWhateverYourFeedbackButtonShouldDo();
config.setMode(ReportingInteractionMode.SILENT);
ACRA.setConfig(config);

where doWhateverYourFeedbackButtonShouldDo() can be something like:

ACRA.getErrorReporter().handleException(new UserFeedbackException(userFeedback));


来源:https://stackoverflow.com/questions/14359485/acra-sometimes-dialog-report-and-other-times-silent-report

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!