`
wang_2011_ying
  • 浏览: 150815 次
  • 性别: Icon_minigender_2
  • 来自: 北京
社区版块
存档分类
最新评论

Activity not started

 
阅读更多
在运行Android程序时,会出现无法运行,提示如下:
ActivityManager: Warning: Activity not started, its current task has been brought to the front
查看了资料才知道这是Android自身的一种处理机制,在Android平台下,通过程序自身退出或是返回按钮结束一个进程时,Android虚拟机未必真正的结束进程,在内存允许的情况下程序会以缓存的形式存在于Android虚拟机中,只有在内存不足的时候,Android系统会清理长时间不被激活的任务,以提供其他程序内存。
所以出现这种情况是在内存足够的情况下,将上一次执行的程序,从缓存Cached状态直接放置到任务的栈顶,则程序就可以继续执行了。
如果不想出现这种情况,只需在运行完程序后,clean一下就好。
分享到:
评论

相关推荐

    PC端通过USB连接手机,检测是否安装某个应用程序

    如果未安装,会提示"Activity not started, its current task has been brought to the front"或类似的错误信息。 4. **执行ADB命令** 在Java代码中,可以通过Runtime类的`exec()`方法来执行adb命令。在提供的示例...

    android常见错误

    Activity not started, its current task has been brought to the front **问题描述**:尝试启动一个活动时,其所属的任务已经在前台,因此启动失败。 **解决方案**: - 确保启动活动的意图(`Intent`)正确设置了...

    What Context.pdf

    creating views all require a Context (and that’s not even getting started on the full list!) to accomplish the task. What I’d like to do is provide for you some insights on how Context works ...

    BURNINTEST--硬件检测工具

    - Changes to trace logging to reduce activity when trace logging is not turned on. - Note: We have seen a report of the Video Playback failing (crash) due to a faulty video codec, ffdshow.ax. If ...

    微软内部资料-SQL性能优化2

    Because device drivers operate at DPC/dispatch level (covered in lesson 2), and page faults are not allowed at this level or above, most device drivers use non-paged pool to assure that they do not ...

    Python-AlistofallnamedGANs

    Every week, new GAN papers are coming out and it's hard to keep track of them all, not to mention the incredibly creative ... So, here's a list of what started as a fun activity compiling all named GANs!

    BUS Hound

    If the search string is not found, the trace position is not changed. Searching is not case sensitive. <br>Drag and Drop <br>To use drag and drop, first select the desired range of lines by ...

    安卓面试技术题

    11. **性能优化**:熟悉ANR(Application Not Responding)的原因和解决方案,理解内存、CPU、电量的优化方法,如何进行UI流畅度的优化。 12. **权限管理**:了解Android 6.0以上的动态权限申请机制,如何处理权限...

    Android学习笔记-service[参考].pdf

    当一个组件(如Activity)调用`startService()`启动Service时,Service将独立运行,不受启动它的组件的影响。Service在此状态下会执行`onStartCommand()`方法,该方法返回一个Integer值,用于指示当Service被系统杀...

    ap6212a0_a33_sc3817r_服务器验证通过_bt已经通了_wifi需要修改配置_需要再次验证_20170626_1549.7z

    调通sina33下的AP6212A0版本的BT 大文实验室/大文哥 壹捌陆捌零陆捌捌陆捌贰 ...完成时间:2017/6/26 11:01 版本:V1.0 本文参照: 《A33 wifi移植说明书.pdf》 还有就是全志R16的parrotv1.1的官方SDK(Android...

    android service实例

    Log.d("MyService", "Service started"); // 在这里执行你的后台任务 return START_STICKY; // 表示如果服务被系统因资源不足杀死,会重新启动 } @Override public void onDestroy() { super.onDestroy(); ...

    使用startservice方法启动服务,并检测服务的生命周期

    常见的返回值有`START_STICKY`、`START_NOT_STICKY`和`START_REDELIVER_INTENT`。 ```java @Override public int onStartCommand(Intent intent, int flags, int startId) { Log.d("MyService", "Service started...

    微软内部资料-SQL性能优化3

    Key range locks are similar to row locks on index keys (whether clustered or not). The locks are placed on individual keys rather than at the node level. The hash value consists of all the key ...

    oracle错误代码大全

    #### ORA-00090: Debugging not started in this instance - **解释**: 在这个实例中未启动调试。 - **解决方案**: 在实例中启用调试。 #### ORA-00091: LARGE_POOL_SIZE not set - **解释**: LARGE_POOL_SIZE未...

    VB编程资源大全(英文源码 网络)

    The application may not be sold in any shape or form. So 下载 the code and get involved with the News Group, help us to help you.<END><br>4 , urllink.zip User control to launch web browser and ...

    2019_2020学年高中英语Unit1FestivalsaroundtheworldSectionⅢUsingLanguage

    6. "In an activity held the other day, an artwork was displayed without the owner's permission, which started controversy." "without one's permission"是常见短语,意为“未经某人允许”,在这里引发了一场...

    android源码实例大全

    1. **Activity和Intent**:Activity是Android应用的基本单元,Intent用于在组件之间传递消息。示例可能包括不同类型的启动模式、Intent flags的使用、数据传递等,通过实践你可以了解它们如何协同工作。 2. **...

    a project model for the FreeBSD Project.7z

    These are usually the most active developers who are willing to spend their time not only integrating their own code but integrating code submitted by the developers who do not have this privilege....

Global site tag (gtag.js) - Google Analytics