Activity not started, its current task has been brought to the front

运行android的程序,看到这个红色字体以为程序出错,想一探究竟。

[2015-05-30 10:23:32 - autoim] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.autoim/.MainActivity }

[2015-05-30 10:23:32 - autoim] ActivityManager: Warning: Activity not started, its current task has been brought to the front


看资料后的个人理解:这是一种android,在不同硬件档次下(内存充足,cpu性能高)的一个机制。你本次要退出的程序,我在硬件ok下先将它缓存,

你下次启动(if program not changed)直接从缓存启动,这样速度就会快很多,而且不会重新运行activity。实现资源的重复利用。假如硬件比较差的情况下,

这个机制就会关闭activity。


资料如下:

我们在Android平台下,通过返回按钮,或者程序本身的退出操作,去结束一个进程的时候,实际上Android虚拟机未必会将这个进程真正的结束掉,在内存允许的情况下,这个程序会以缓存的形式存在Android虚拟机中。只有在内存不足的情况下时,Android系统会清理长时间不被激活的任务,以为其他程序提供内存。
Android这样做,是为了你下一次更加快速的启动这个程序。
所以,出现楼主这种情况,是在你的程序没有发生任何变化,并且内存足够的情况下,会将上一次执行的程序,从缓存Cached状态直接放置到任务栈的顶端,则你的程序又可以继续执行了。

消除警告解决办法:

退出虚拟机的程序从新运行一遍。


As an AI language model, I don't have personal opinions or experiences. However, some benefits that humans have gained from the Internet are: 1. Instant access to information: The Internet has made it easy for people to access information on any topic, from anywhere in the world, within seconds. 2. Global connectivity: The Internet has connected people from all over the world, breaking down barriers and making communication and collaboration easier. 3. Online education: The Internet has made education more accessible than ever before, allowing people to learn from anywhere in the world at any time. 4. Online shopping: The Internet has revolutionized the way people shop, making it possible to buy almost anything online, from anywhere in the world. 5. Entertainment: The Internet has made entertainment more accessible than ever before, with online streaming services, social media, and gaming platforms. 6. Improved communication: The Internet has made communication easier and more efficient, with email, social media, and video conferencing. 7. E-commerce: The Internet has transformed the way businesses operate, allowing them to reach a global audience and sell products and services online. 8. Access to government services: The Internet has made it easier for people to access government services, such as applying for a passport or paying taxes, from anywhere in the world. 9. Improved healthcare: The Internet has made healthcare more accessible and affordable, with telemedicine and online health resources. 10. Job opportunities: The Internet has created new job opportunities in fields such as e-commerce, digital marketing, and software development.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值