是的,这是崩溃报告对话框。是的,报告会发送到开发者控制台。不,您不能回复反馈。是的,根据您引用的帖子,它需要 API 14,否则不能使用。无法自定义对话框。查看对话框功能的最佳方法是使用提供它的应用程序打开它。
根据您的问题,听起来您的要求超出了此对话框的能力范围,您可能需要发明一个本土解决方案或使用第三方解决方案。
我已使用此代码片段来启用发送反馈并显式打开带有已处理异常的对话框。
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
public ApplicationErrorReport createErrorReport (Exception e) {
ApplicationErrorReport report = new ApplicationErrorReport ();
report.packageName = report.processName = this.getPackageName ();
report.time = System.currentTimeMillis ();
report.type = null == e ? ApplicationErrorReport.TYPE_NONE : ApplicationErrorReport.TYPE_CRASH;
report.systemApp = false;
if (null != e) {
ApplicationErrorReport.CrashInfo crash = new ApplicationErrorReport.CrashInfo ();
crash.exceptionClassName = e.getClass ().getSimpleName ();
crash.exceptionMessage = e.getMessage ();
StringWriter writer = new StringWriter ();
PrintWriter printer = new PrintWriter (writer);
e.printStackTrace (printer);
crash.stackTrace = writer.toString ();
StackTraceElement stack = e.getStackTrace ()[0];
crash.throwClassName = stack.getClassName ();
crash.throwFileName = stack.getFileName ();
crash.throwLineNumber = stack.getLineNumber ();
crash.throwMethodName = stack.getMethodName ();
report.crashInfo = crash;
}
return report;
}