Search code examples
androidacra

ACRA: How to execute code when crash is reported


Possible Duplicate:
ACRA with android: How to execute code before crash is reported

I am using ACRA for crash reporting. When a crash happens, ACRA reports. how can I execute a code before a crash gets reported? I want to add some custom variables when crash happens so it gets sent along with the report. Is there a function I can override or something like that?

Thanks


Solution

  • If you want to report extra variables, the easiest method is to set them with the ErrorReporter's putCustomData method each time the variable values changes. This way you'll have the correct value if a crash occurs.

    Alternatively, you might be able to execute code by implementing your own sender.