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

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

问题描述

在以往的任何应用程序崩溃来我想从应用程序退出?
如何实现相同。没有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天全站免登陆