开发者

killProcess can be used in some cases?

I have a logout button in my activity. In my case the killProcess do what I want to do instead of the finish(), 开发者_运维问答but is it a good idea to use killProcess? I have read that is better not to use killProcess but in some cases seems to be useful.


Calling killProcess stops the process immediately. There is no way for your app to prevent this or prepare for it. However, when you call finish you app is notified and is given a chance to release system resources, save states, etc. Using finish is the recommended and preferred way to shut things down. To use killProcess would be considered hackish and bad style.

If you are having problems with finish() closing the app fast enough you should consider overloading that method.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜