ActivityManager: Warning: Activity not started, its current task has been brought to the front 的的问题
运行android程序的时候提示:ActivityManager: Warning: Activity not started, its current task has been brought to the front
但是在模拟器上显示出了程序界面,后来google了一下,
有一组提问和回答引起了我的注意:
- 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:
- 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状态直接放置到任务栈的顶端,则你的程序又可以继续执行了。
消除警告解决办法:
退出虚拟机的程序从新运行一遍。
ActivityManager: Warning: Activity not started, its current task has been brought to the front 的的问题的更多相关文章
- JAVA Eclipse ActivityManager Warning Activity not started, its current task has been brought to the front怎么办
Eclipse运行提示Activity not started,因为当前程序已经在运行,需要退出当前程序再测试
- 问题: ActivityManager: Warning: Activity not started, its current task has been brought to the front
运行程序时看控制台有这样的错误,应用程序没跑起来. 解决办法:project-->Clean
- 出现错误ActivityManager: Warning: Activity not started, its current task has been
1.在学习两个Activity的切换时,重新把新的工程部署上模拟器时候出现错误:ActivityManager: Warning: Activity not started, its current ...
- Activity not started, its current task has been brought to the front
运行错误:Activity not started, its current task has been brought to the front . 原因分析:因为你的模拟器中还有东西在运行,也就是 ...
- Activity not started, its current task has been brought to the front的解决办法
删除bin目录下所有文件,重新启动在试试
- (转载)activity外部调用startActivity的new task异常解析
activity外部调用startActivity的new task异常解析 泡在网上的日子 / 文 发表于2013-09-07 12:45 第1314次阅读 异常,android,activity ...
- ActivityJump+ActivityManager【Activity之间的跳转和Activity任务栈管理】
版权声明:本文为HaiyuKing原创文章,转载请注明出处! 前言 封装Activity跳转的方法以及实现Activity任务栈管理. 效果图 代码分析 ActivityJump:封装Activi ...
- android开发中经常遇到的问题汇总
大家都在为项目开发成功而喜悦,但可不知成功的路上是会经常出错的,下面是我碰到的一些错误集合! [错误信息] [2011-01-19 16:39:10 - ApiDemos] WARNING: Appl ...
- Android虚拟机运行问题之小结
首先说一下关于虚拟机的技巧,以前我也总是感觉电脑运行虚拟机的时候老是卡,后来在看课堂直播时看到老师用的是Total Control,在网上搜“Total Control”就能能找到,比系统自带SDK运 ...
随机推荐
- 处理一则MySQL Slave环境出现ERROR 1201 (HY000): Could not initialize master info structure的案例
mysql> start slave; ERROR (HY000): Slave failed to initialize relay log info structure from the r ...
- 【转载】Spring中DispatcherServlet与ContextLoaderListener的区别
昨天在写springmvc的时候,在web.xml中配置了DispatcherServlet,如下: <servlet> <servlet-name>DispatcherSer ...
- EntityFrame6在本地可以正常使用,部署到IIS后报异常(Additional information: The underlying provider failed on Open.)
异常详细:An exception of type 'System.Data.Entity.Core.EntityException' occurred in EntityFramework.SqlS ...
- 时隔8年HTML 5终于定稿!
我们第一次谈论 HTML5 要改变世界大概是因为乔布斯,他坚持在 iOS 上不兼容 Flash,在 Adobe 统治多媒体开发的那个年代,这需要付出极大的勇气.这么多年过去了,虽然所有人都在谈论 HT ...
- [CF]codeforces round#366(div2)滚粗记
开场心理活动:啊打完这场大概有1700了吧 中途心理活动:啊这个ABC看起来都随便做啊 死亡原因:欸怎么没网了 -75 .. A [题意]Hulk说完一句I hate会说that I love 然后是 ...
- java和javascript真的有关系=。=
相同点:1. 内存管理,两者都采用GC来对内存进行回收.因此Java与javascript的内存泄露情况十分相似. 2. 代码编译为机器码后由中间件执行:Java使用前会编译为字节码后由JVM执行,V ...
- 01-04-01【Nhibernate (版本3.3.1.4000) 出入江湖】原生的SQL查询
Nhibernate 支持原生的SQL查询 : /// <summary> /// 使用原生的SQL查询 /// </summary> /// <param name=& ...
- Javascript表格中搜索
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...
- POJ1573Robot Motion
http://poj.org/problem?id=1573 #include<stdio.h> #include<stdlib.h> #include<cstring& ...
- Android中自定义Checkbox
custom_checkbox.xml文件: <?xml version="1.0" encoding="utf-8"?> <selector ...