应用程序崩溃时退出 [英] Exit on application crash

查看:35
本文介绍了应用程序崩溃时退出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当任何应用程序崩溃时,我想退出应用程序?
如何实现相同.Android 清单是否有任何相同的规定.

when ever any application crash come I want to exit from the app ?
How to achieve same. does Android manifest have any provision for same.

推荐答案

我建议注册一个全局 UncaughtExceptionHandler.这会捕获所有未处理的异常.然后你可以在那里做你想做的事.例如关闭应用程序,通知用户并向自己发送日志.

I would recommend to register a global UncaughtExceptionHandler. This catches all the exceptions that are not handled. Then you can do there what you want. For example close the app, inform the user and send a log to yourself.

这篇关于应用程序崩溃时退出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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