ActivityManager: Warning: Activity not started, its current task has been brought to the front 的的问题
2015-06-13 10:09
567 查看
运行android程序的时候提示:ActivityManager: Warning: Activity not started, its current task has been brought to the front
但是在模拟器上显示出了程序界面,后来google了一下,
有一组提问和回答引起了我的注意:
[html] view
plaincopy
Hi,
I have a very simple android project. I got the following error message when I try to run it. The emulator is running but the application doesn't come up. I couldn't find any useful information online. Can anyone help me?
Thanks,
arning: Activity not started, its current task has been brought to the front public class Profile extends Activity { /Button button1; CheckBox check1, check2; EditText text1;/
Answer:
[html] view
plaincopy
Hi Lewis!
It is not an error message, it is a warning. What the system is trying to tell you: The application on the device is the same as your application in Eclipse. And because the application is already running on the device, the system tells you that it is not going to kill and restart it, but bring the activity of your already running app into the foreground. This is pretty normal. ;-)
The warning will not continue if you edit your code and run it (because the app is then killed, reinstalled and started) or if you kill your process on the phone, e.g. via the DDMS.
解释:
这个不是Android平台的Bug,而是Android本身就是这样一种处理机制。
我们在Android平台下,通过返回按钮,或者程序本身的退出操作,去结束一个进程的时候,实际上Android虚拟机未必会将这个进程真正的结束掉,在内存允许的情况下,这个程序会以缓存的形式存在Android虚拟机中。只有在内存不足的情况下时,Android系统会清理长时间不被激活的任务,以为其他程序提供内存。
Android这样做,是为了你下一次更加快速的启动这个程序。
所以,出现楼主这种情况,是在你的程序没有发生任何变化,并且内存足够的情况下,会将上一次执行的程序,从缓存Cached状态直接放置到任务栈的顶端,则你的程序又可以继续执行了。
消除警告解决办法:
退出虚拟机的程序从新运行一遍。
但是在模拟器上显示出了程序界面,后来google了一下,
有一组提问和回答引起了我的注意:
[html] view
plaincopy
Hi,
I have a very simple android project. I got the following error message when I try to run it. The emulator is running but the application doesn't come up. I couldn't find any useful information online. Can anyone help me?
Thanks,
arning: Activity not started, its current task has been brought to the front public class Profile extends Activity { /Button button1; CheckBox check1, check2; EditText text1;/
Answer:
[html] view
plaincopy
Hi Lewis!
It is not an error message, it is a warning. What the system is trying to tell you: The application on the device is the same as your application in Eclipse. And because the application is already running on the device, the system tells you that it is not going to kill and restart it, but bring the activity of your already running app into the foreground. This is pretty normal. ;-)
The warning will not continue if you edit your code and run it (because the app is then killed, reinstalled and started) or if you kill your process on the phone, e.g. via the DDMS.
解释:
这个不是Android平台的Bug,而是Android本身就是这样一种处理机制。
我们在Android平台下,通过返回按钮,或者程序本身的退出操作,去结束一个进程的时候,实际上Android虚拟机未必会将这个进程真正的结束掉,在内存允许的情况下,这个程序会以缓存的形式存在Android虚拟机中。只有在内存不足的情况下时,Android系统会清理长时间不被激活的任务,以为其他程序提供内存。
Android这样做,是为了你下一次更加快速的启动这个程序。
所以,出现楼主这种情况,是在你的程序没有发生任何变化,并且内存足够的情况下,会将上一次执行的程序,从缓存Cached状态直接放置到任务栈的顶端,则你的程序又可以继续执行了。
消除警告解决办法:
退出虚拟机的程序从新运行一遍。
相关文章推荐
- FMDB
- 第二段冲刺进程4
- 解析struts.xml
- 分布式Session框架
- 第二段冲刺进程4
- Centos 5.5下安装samba
- PHYSICALLY-BASED 小镇的demo
- android 通过组件属性动态创建控件并设置布局
- 第二阶段冲刺 站立会议04
- 第二阶段冲刺 站立会议03
- nginx支持缓存302重定向后的文件到本地
- ios-day24-01(SQLite数据库之SQL语句:建表、删表、CRUD、主键约束、排序、条件语句等等)
- PCL库依赖第三方库的功能说明--摘录点云库PCL学习教程
- ! Undefined control sequence. \CJK@XXX ...endcsname {`#2}{`#3}\CJK@ignorespaces \fi l.43 \end{document}
- Bootstrap 模态框(Modal)插件
- 读数学之美——统计语言模型(马尔科夫)
- win10网络位置怎么设置 win10网络位置设置图文教程
- JQuery中DOM加载与事件执行实例分析
- Java serve_ client聊天之client端(合工大java实验四)by峰宇
- 整合ssh框架的具体步骤