【发布时间】:2020-10-04 15:27:31
【问题描述】:
我正在尝试向我的应用添加 acra 支持,以便在应用崩溃时发送报告。我上课了:
@ReportsCrashes(formUri = "",
mailTo = "****@gmail.com",
mode = ReportingInteractionMode.TOAST,
customReportContent = Array<ReportField>(5) { i: Int -> ReportField.ANDROID_VERSION },
resToastText = R.string.crash_toast_text)
class AcraReports : Application() {
override fun onCreate() {
super.onCreate()
ACRA.init(this)
}
}
但我无法添加此行来定义我要发送的数据:
customReportContent = Array<ReportField>(5) { i: Int -> ReportField.ANDROID_VERSION },
this example 这个字段是这样定义的:
customReportContent = { /* */ReportField.APP_VERSION_NAME, ReportField.PACKAGE_NAME,ReportField.ANDROID_VERSION, ReportField.PHONE_MODEL,ReportField.LOGCAT },
但是这段代码不起作用:(我做错了什么以及如何将此信息添加到我的消息中?
【问题讨论】: