If a Activity performDestroy, and there is window not closed whose window token is the Activity's mWindow, WindowLeaked exception will occur.

Especially, app adds a view to WindowManager, when the app come across a crash, and if the app not remove the view from WindowManager at Activity's onDestory() callback funtion, the WindowLeaked exception occurs.

When an app come across an exception, the activity will performStop() first, in this function, will callback mWindow's closeAllPanels() which will close all menus window. And then, activity will performDestory(), in this function will call WindowManagerGlobal's closeAll() function, if there is any window associate with the activity's mWindow, close it and report a WindowLeak.

So, to avoid this. You should make sure to remove all views added to WindowManager before the activity be destroyed.

By the way, WindowManager's removeView() and removeViewImmediate is different. The later will cause a immediate remove.

How WindowLeaked exception occured?的更多相关文章

  1. Symfony 没有找到数据库驱动An exception occured in driver: could not find driver

    如果一直报这个错误, 第一,你本地没有相关的数据库驱动(mysql:-->pdo_myql,postgresql-->pdo_pgsql等); 需要执行 php -m|grep -i pd ...

  2. Cobbler安装报错--dhcpd -t failed Exception occured: <class 'cobbler.cexceptions.CX'>

    最近想玩一下自动化安装,就研究了一下cobbler,测试环境本来是想用CentOS6.X的,但是后来一想,还是想用CentOS7.X.然后就碰到坑了. 在同步cobbler配置的时候,发现了以下错误: ...

  3. CC3200作为STA模式连接路由器sl_WlanConnect出现exception occured at:0xa72fcf6

    1. 先看下出错的提示 2. 出错的代码部分,现在问题是定位不到哪一行代码出问题,反正运行一段时间就进入了 lRetVal = sl_WlanConnect((signed , &secPar ...

  4. (C#) Tasks 中的异常处理(Exception Handling.)

    多线程编程中要注意对线程异常的处理.首先写个例子. 一个线程用于显示信息(Show Messages).主线程用于做其他工作(Do Works). using (Task taskShowMessag ...

  5. [BTS] Exception occurred when persisting state to the database

    Error 1 Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'J ...

  6. Error Handling and Exception

    The default error handling in PHP is very simple.An error message with filename, line number and a m ...

  7. Exception from System.loadLibrary(smjavaagentapi) java.lang.UnsatisfiedLinkError: no smjavaagentapi in java.library.path

    可能原因: 缺少smjavaagentapi.jar文件或者libsjavaagentapi.so缺少相关的依赖包. 解决方法: 1. 检查sso的lib下面是否有smjavaagentapi.jar ...

  8. 给jquery-validation插件添加控件的验证回调方法

    jquery-validation.js在前端验证中使用起来非常方便,提供的功能基本上能满足大部分验证需求,例如:1.内置了很多常用的验证方法:2.可以自定义错误显示信息:3.可以自定义错误显示位置: ...

  9. Spring 4 使用Freemarker模板发送邮件&添加附件

    前言 Spring对Java的邮件发送提供了很好的支持,提供了超级简单的API,大大简化了Java邮件发送功能的开发. Spring对Email的支持是基于JavaMail API开发的,所以,我们在 ...

随机推荐

  1. 为什么sudo执行命令还是会提示权限不够

    安装openstack 的过程中需要执行以下命令,虽然使用了sudo,但是依然提示权限不够 $ sudo echo "deb http://ubuntu-cloud.archive.cano ...

  2. 由import javax.persistence.*;引用引发问题的思考(SpringBoot)

    在学习SpringBoot的 JPA时候增加一个实体类的时候发现import包的时候一直报错. 对比一下,发现自己的项目里面是少了 spring-boot-starter-data-jpa.jar包的 ...

  3. Angular material mat-icon 资源参考_Social

    ul,li>ol { margin-bottom: 0 } dt { font-weight: 700 } dd { margin: 0 1.5em 1.5em } img { height: ...

  4. stark - 2 ⇲路由分发

    在介绍前面三个注意点后,开始写stark组件内容. from django.apps import AppConfig from django.utils.module_loading import ...

  5. sublime text3 license & nodejs setting

    ----- BEGIN LICENSE ----- sgbteam Single User License EA7E-1153259 8891CBB9 F1513E4F 1A3405C1 A865D5 ...

  6. docker 把容器commit成镜像

    该方法是使用docker commit 命令,其命令格式为:  docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]] 主要参数选项包括: -a ,– ...

  7. 安装APK时报 Installation failed with message Failed to finalize session : INSTALL_FAILED_USER_RESTRICTED: Invalid apk.

    Installation failed with message Failed to finalize session : INSTALL_FAILED_USER_RESTRICTED: Invali ...

  8. 20164324王启元 Exp1 PC平台逆向破解

    一.逆向及Bof基础实践说明 1.1实践目标 本次实践的对象是一个名为pwn1的linux可执行文件. 该程序正常执行流程是:main调用foo函数,foo函数会简单回显任何用户输入的字符串. 手工修 ...

  9. PaymentServlet代码

    package ${enclosing_package}; import java.io.IOException; import java.util.ResourceBundle; import ja ...

  10. c++ 常用的遍历,删除,分割等等文件处理函数代码实现

    原文作者:aircraft 原文链接:https://www.cnblogs.com/DOMLX/p/9622851.html 删除文件目录函数: void myDeleteDirectory(CSt ...