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. 图论 竞赛图(tournament)学习笔记

    竞赛图(tournament)学习笔记 现在只是知道几个简单的性质... 竞赛图也叫有向完全图. 其实就是无向完全图的边有了方向. ​ 有一个很有趣的性质就是:一个tournament要么没有环,如果 ...

  2. pydicom读取dicom文件报错

    之前采用pydicom读取dicom文件一切都很正常,不过最近读取一批数据的时候,会报错 读取代码 file = pydicom.read_file(filepath) data = file.pix ...

  3. java8特性之Lambda表达式

    1.典型的用Lambda表达式的场景 如果有这样的一个小应用,其中的一个类Student包含姓名(name),性别(sex),分数(score),如下: package demo; public cl ...

  4. Q806 写字符串需要的行数

    我们要把给定的字符串 S 从左到右写到每一行上,每一行的最大宽度为100个单位,如果我们在写某个字母的时候会使这行超过了100 个单位,那么我们应该把这个字母写到下一行.我们给定了一个数组 width ...

  5. Python3 scrapy 新手命令

    基本命令 建立项目 scrapy startproject projectname #在CMD命令框内执行,路径是你需要保存的位置 建立爬虫 cd projectname #在CMD命令框内执行,目的 ...

  6. Shiro源码解析-登录篇

    本文以循序渐进的方式解析Shiro整个login过程的处理,读者可以边阅读本文边自己看代码来思考体会,如有问题,欢迎评论区探讨! 笔者shiro的demo源码路径:https://github.com ...

  7. pymysql 各种坑总结

    pymysql各种坑只针对自己的项目1.关于关闭连接,报错为:pymysql.err.InterfaceError: (0, '') 这个错误原因:对已经关闭的链接再次进行操作,参考MySQL.err ...

  8. docker 把容器commit成镜像

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

  9. 漫谈TCPIP协议原理

    一.每次说道TCPIP协议,有能说会道者,总爱说三次握手,什么意思? 顾名思义,假设有两个机器A和B 1.当A发送给B一个包的时候,B接收到了,这个时候,B有两个选择,要么将包数据放入缓存,等待处理, ...

  10. 理解ReentrantLock的公平锁和非公平锁

    学习AQS的时候,了解到AQS依赖于内部的FIFO同步队列来完成同步状态的管理,当前线程获取同步状态失败时,同步器会将当前线程以及等待状态等信息构造成一个Node对象并将其加入到同步队列,同时会阻塞当 ...