繁体   English   中英

不要让活动选项不起作用

[英]Don't keep activities option not working

嗨,我在Developer Settings下启用了 Don't Keep Activities 选项。 但它似乎不起作用。

例如

假设我有一个通过意图启动浏览器的应用程序。 从理论上讲,既然用户已经离开了我的应用程序,它应该杀死它吗? 但事实并非如此。 按下后退按钮,它会将我带到我的应用程序。 如果我正确理解了这个选项,请告诉我。 如果我这样做了,想知道为什么它不起作用

终止活动并不意味着关闭应用程序。 它只会破坏活动并释放设备资源。 当您按“后退”按钮时,将再次重新创建上一个活动,就好像它是第一次打开一样。

使用此选项等效于使用任务杀手。 在Android上,任务杀手要比没用的要糟。 如果您使用任务杀手, 则会通过丢弃高速缓存的数据并迫使Android在每次重新打开应用程序时从系统存储中加载应用程序来减慢系统速度

它会重新产生活动,因此过程比平时更多

来源-https: //www.quora.com/Is-the-Dont-keep-activities-option-under-Developer-Settings-really-effective-in- Saving- battery

当您将意图用于其他活动时,上一个活动t destroyed. Tne method onStop() is called when you use an intent. You can read about the activity lifecycle and the methods, that are called due to different situations. So, your activity is stopped but not destroyed! Also, the **don t destroyed. Tne method onStop() is called when you use an intent. You can read about the activity lifecycle and the methods, that are called due to different situations. So, your activity is stopped but not destroyed! Also, the **don t destroyed. Tne method onStop() is called when you use an intent. You can read about the activity lifecycle and the methods, that are called due to different situations. So, your activity is stopped but not destroyed! Also, the **don保留活动”选项用于不同的调试工作。 这会使您的手机非常慢。 您的手机必须关闭该应用程序,然后再次打开它,这会占用大量内存和电池。

以下是如何充分利用这一切:

不要保持活动 -> 打开
后台进程限制 -> 无后台进程

暂无
暂无

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

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