MonoDroid:全局错误处理程序 [英] MonoDroid: Global Error Handler

查看:123
本文介绍了MonoDroid:全局错误处理程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法来创建MonoDroid一个全球性的错误处理程序?我的调试器坏了,所以我需要一种方法来的时候看到应用程序崩溃的异常信息。

Is there a way to create a global error handler for MonoDroid? My debugger is broken so I need a way to see the exception info while the application crashes.

推荐答案

看来, AndroidEnvironment.UnhandledExceptionRaiser 是你在找什么:

//that's a dirty-code example, do not use as-is! :)
AndroidEnvironment.UnhandledExceptionRaiser += (sender, args) =>
                {
                    File.AppendAllText("tmp.txt", args.Exception.ToString());
                };

这篇关于MonoDroid:全局错误处理程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆