处理未处理的Andr​​oid中的异常 [英] handle unhandled exceptions in Android

查看:137
本文介绍了处理未处理的Andr​​oid中的异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows Phone 7的开发人员提供了一个Application_UnhandledException事件提供含有发生的任何未处理的异常信息和堆栈跟踪一个异常对象。有此对象存储在本地存储器的机会。在下次启动时,我们可以检查这样一个对象,并通过电子邮件发送给开发者。显然,这是诊断生产崩溃有价值的。

有没有这样的事情在Android的存在吗?
谢谢,加里


解决方案

  java.lang.Thread.setDefaultUncaughtExceptionHandler(UncaughtExceptionHandler的处理程序)

这是你想要的吗?

In Windows phone 7, developers are provided an Application_UnhandledException event that provides an exception object containing information and stack trace of any unhandled exception that occurs. There is an opportunity to store this object in local storage. On next startup we can check for such an object and email it to the developer. Obviously this is valuable in diagnosing production crashes.

Does such a thing exist in Android? Thanks, Gary

解决方案

java.lang.Thread.setDefaultUncaughtExceptionHandler(UncaughtExceptionHandler handler)

Is this what you want?

这篇关于处理未处理的Andr​​oid中的异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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