简体   繁体   English

Android:通话结束后,应用程序仍在运行

[英]Android: Application still running after call finish()

I'm new at Android Development... 我是Android开发的新手...

I create a new activity and call finish(); 我创建一个新活动并调用finish(); method. 方法。 But it still running, consuming battery, memory... 但是它仍然在运行,消耗电池,内存... 活动销毁后的电池和内存消耗

Is there a way of stop the application completely, avoiding battery and memory consumption after activity is destroyed? 有没有一种方法可以完全停止应用程序,从而避免在活动销毁后消耗电池和内存?

finish method just finish the intent! 完成方法只是完成意图! If you want to exit from app then use 如果您想退出应用,请使用

system.exit(0);

Duplicated Question! 重复的问题!

You can't control when your app leaves the main memory, the OS does. 您无法控制应用程序何时离开主内存,而操作系统却如此。 Look closely at Activity.finish() 仔细看看 Activity.finish()

I think there will be no way of stopping the application completely, avoiding battery and memory consumption after the activity is destroyed. 我认为没有办法完全停止应用程序,避免在活动被破坏后避免消耗电池和内存。

Answer(Link) is : Activity.finish() called but activity stays loaded in memory 答案(链接)为:已调用Activity.finish(),但活动仍保持加载到内存中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM