首页 > 移动平台 > 详细

Xamarin.Android捕获全局未处理异常

时间:2015-04-10 18:08:11      阅读:164      评论:0      收藏:0      [点我收藏+]

大家可能尝试过使用原生比较普遍使用的方法:

            Java.Lang.Thread.DefaultUncaughtExceptionHandler = new UncaughtExceptionHanlder(UncaughtExceptionHandle);

但是发现没什么用,又会尝试使用c#的方法:

AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

可能发现部分有用,我也是被这个问题折磨了好久,特别是以前,查看了好多资料也没找到解决的办法,今天在群里,发现有

群友提供的代码解决了这个问题,代码如下:

  AndroidEnvironment.UnhandledExceptionRaiser += (o, e) =>
            {
            };

Xamarin.Android捕获全局未处理异常

原文:http://blog.csdn.net/supluo/article/details/44980367

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!