关于关闭或退出问题的apk [英] Question about close or exit apk

查看:447
本文介绍了关于关闭或退出问题的apk的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何关闭APK或者换句话说,退出APK。我有尝试结束,但它只是关闭当前的活动,我需要关闭的APK ??

How do i close the apk or in other words to EXIT the APK . i have try finish but it just closing the current activity and i need to close all the activities in the apk??

推荐答案

应用程序的活动只是松散的邦联,而且也没有的退出应用程序内置于Android的概念。如果你想要做的事一种模拟退出,你必须手动跟踪哪些活动依然存在,完成()每一个在列表中。

Applications are just loose confederations of activities, and there's no notion of "exiting an application" built into Android. If you want to do something that simulates exiting, you'll have to manually keep track of which activities still exist and finish() each one in the list.

这是更好没有退出的概念来设计应用程序,让系统破坏它的部分需要。这符合在Android的设计原则之一,这是用户可能要返回到他离开,而不全了重启延迟的应用程序。如果有东西在你的活动需要被缠绕下来,走活动周期的优势,做他们在适当的 onXXX()方法。

It's better to design your application without the concept of "exiting" and let the system destroy its parts as needed. This fits in with one of Android's design principles, which is that the user may want to return to an application he left without the delays of a full-up restart. If there are things in your activities that need to be wound down, take advantage of the activity lifecycle and do them in the appropriate onXXX() method.

这篇关于关于关闭或退出问题的apk的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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