android使用finish()和System.exit()退出应用程序的理解
2012-02-17 13:58
525 查看
this.finish() in Activity only stop and destroy this activity, application still staying background (check by hold HOME button)
I used:
System.exit(0);
but it still appear there!
That's how Android works. The user/developer is not given any way to actually exit the application. When you call 'finish', the application stack is just pushed to the background. It still exists in the memory. Android itself decides when to close the application(i.e. remove its instance from the memory) and generally this is done when your application becomes the oldest application which was not used for the longest time.
this.finish()主要是对Activity,当前的Activity结束了,但是整个Application还是在内存中运行,此时Application就成为了background进程,System.exit(0)是结束当前进程
I used:
System.exit(0);
but it still appear there!
That's how Android works. The user/developer is not given any way to actually exit the application. When you call 'finish', the application stack is just pushed to the background. It still exists in the memory. Android itself decides when to close the application(i.e. remove its instance from the memory) and generally this is done when your application becomes the oldest application which was not used for the longest time.
this.finish()主要是对Activity,当前的Activity结束了,但是整个Application还是在内存中运行,此时Application就成为了background进程,System.exit(0)是结束当前进程
相关文章推荐
- android使用finish()和System.exit()退出应用程序的理解
- Android退出APP,finish()与System.exit(0)
- 关于Android开发中使用System.exit(0)的问题(如写返回键响应时用到双击退出函数的时候)
- android 完全退出应用程序 使用ExitApplication.
- 关于按返回键退出App之finish()与System.exit(0)结合使用
- Android中使用System.exit(0)退出后app又重新启动
- android中finish和system.exit方法退出的区别
- Android关于finish()与System.exit()都不能退出应用的原因
- android 退出选项 System.exit(0)和finish()的区别
- Java应用程序添加退出事件响应 (关闭虚拟机而不是程序-system.exit)
- android开发两种退出程序方式(killProcess,System.exit)
- android Activity类中的finish()、onDestory()和System.exit(0) 三者的区别
- android应用程序对System.gc()的使用必要
- android开发时,finish()跟System.exit(0)的区别(转)
- Android开发—Activity中的finish()、OnDestroy()和System.exit()的区别
- (转)Android开发-Activity中finish() onDestroy() 和System.exit()的区别
- Android中调用System.exit(0)和android中finish()与system.exit(0)的区别
- Android中finish和System.exit(0)的区别
- Android Activity类中的finish()、onDestory()和System.exit(0) 三者的区别