运行android程序的时候提示:ActivityManager: Warning: Activity not started, its current task has been brought to the front

但是在模拟器上显示出了程序界面,后来google了一下,

有一组提问和回答引起了我的注意:

  1. Hi,
  2. 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?
  3. Thanks,
  4. 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:

  1. Hi Lewis!
  2. 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. ;-)
  3. 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状态直接放置到任务栈的顶端,则你的程序又可以继续执行了。

消除警告解决办法:

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

ActivityManager: Warning: Activity not started, its current task has been brought to the front 的的问题的更多相关文章

  1. JAVA Eclipse ActivityManager Warning Activity not started, its current task has been brought to the front怎么办

    Eclipse运行提示Activity not started,因为当前程序已经在运行,需要退出当前程序再测试

  2. 问题: ActivityManager: Warning: Activity not started, its current task has been brought to the front

    运行程序时看控制台有这样的错误,应用程序没跑起来. 解决办法:project-->Clean

  3. 出现错误ActivityManager: Warning: Activity not started, its current task has been

    1.在学习两个Activity的切换时,重新把新的工程部署上模拟器时候出现错误:ActivityManager: Warning: Activity not started, its current ...

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

    运行错误:Activity not started, its current task has been brought to the front . 原因分析:因为你的模拟器中还有东西在运行,也就是 ...

  5. Activity not started, its current task has been brought to the front的解决办法

    删除bin目录下所有文件,重新启动在试试

  6. (转载)activity外部调用startActivity的new task异常解析

    activity外部调用startActivity的new task异常解析 泡在网上的日子 / 文 发表于2013-09-07 12:45  第1314次阅读 异常,android,activity ...

  7. ActivityJump+ActivityManager【Activity之间的跳转和Activity任务栈管理】

    版权声明:本文为HaiyuKing原创文章,转载请注明出处! 前言 封装Activity跳转的方法以及实现Activity任务栈管理. 效果图   代码分析 ActivityJump:封装Activi ...

  8. android开发中经常遇到的问题汇总

    大家都在为项目开发成功而喜悦,但可不知成功的路上是会经常出错的,下面是我碰到的一些错误集合! [错误信息] [2011-01-19 16:39:10 - ApiDemos] WARNING: Appl ...

  9. Android虚拟机运行问题之小结

    首先说一下关于虚拟机的技巧,以前我也总是感觉电脑运行虚拟机的时候老是卡,后来在看课堂直播时看到老师用的是Total Control,在网上搜“Total Control”就能能找到,比系统自带SDK运 ...

随机推荐

  1. MyEclipse 安装JRebel进行热部署

    安装环境 版本:myeclipse2015stable2 说明:下面是我已经安装了界面 安装过程 进入市场 出现下面提示,不用管它,点Continue 用关键词搜索 配置 进入JRebel配置中心,配 ...

  2. InterlliJ调试:Method breakpoints may dramatically slow down debugging

    问题:Method breakpoints may dramatically slow down debugging 因为此问题久久不能调试.问题发现后原来如此... 原因:设置了方法断点!--什么是 ...

  3. 剑指offer--面试题5

    到现在为止,看过的书+代码有一定量了,并且也参加了个比赛,给自己的总体感觉:编程需要的是灵活的头脑,书里的东西只是讲个规则.思想,其实际实现可以千差万别!   潜在的规则+灵活的思维 = 程序! 在做 ...

  4. 项目中的Libevent(多线程)

    多线程版Libevent //保存线程的结构体 struct LibeventThread { LibEvtServer* that; //用作传参 std::shared_ptr<std::t ...

  5. app被Rejected 的各种原因翻译

    1. Terms and conditions(法律与条款) 1.1 As a developer of applications for the App Store you are bound by ...

  6. 同一机器 部署 两个 jboss

    当jboss和oracle在同一机器上时,通常oracle占用8080端口,这时只需要去修改\deploy\jbossweb-tomcat50.sar\server.xml中.当在同一台机器上运行两个 ...

  7. POJ 1666

    #include<iostream> using namespace std; int main() { int num_stu; int i; ; do{ time=; cin>& ...

  8. Namespace, string, vector and array

    1. Headers should not include using declaration Code inside headers ordinarily should not include us ...

  9. Thread的第一天学习

    1.实现线程的方法: 1)extend Thread 2)implements Runnable 2.下面代码执行哪个run方法: new Thread( new Runnable(){ public ...

  10. 可持久化trie 学习总结

    QAQ 以前一直觉得可持久化trie很难,今天强行写了一发觉得还是蛮简单的嘛 自己的模板是自己手写的,写了几道题目并没有出过错误 THUSC的第二题的解法五貌似就是可持久化trie,时间复杂度O(60 ...