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. [agc004e]Salvage Robots dp

    Description 蛤蟆国的领土我们可以抽象为H*W的笼子,在这片蛤土上,有若干个机器人和一个出口,其余都是空地,每次蛤蟆会要求让所有的机器人向某个方向移动一步,当机器人移动到出口时会被蛤蟆活摘出 ...

  2. jquery事件一 ---鼠标移入移出

    比较一下几个jquery事件的区别 mouseover() 鼠标进入(进入子元素也触发) mouseout() 鼠标离开(离开子元素也触发) mouseenter() 鼠标进入(进入子元素不触发) m ...

  3. 什么是cluster(群集)

    一.群集的概念 在互联网应用中,随着站点对硬件性能.相应速度.服务稳定性.数据可靠性等要求越来越高,单台服务器力不从心,使用小型机或大型机价格还太昂贵,因此我们使用普通服务器来构建服务群集显然最划算. ...

  4. loj #6570. 毛毛虫计数

    $ \color{#0066ff}{ 题目描述 }$ hsezoi 巨佬 olinr 喜欢 van 毛毛虫,他定义毛毛虫是一棵树,满足树上存在一条树链,使得树上所有点到这条树链的距离最多为 1. 给定 ...

  5. 51 Nod 1042 数位dp

    1042 数字0-9的数量 1 秒 131,072 KB 10 分 2 级题   给出一段区间a-b,统计这个区间内0-9出现的次数. 比如 10-19,1出现11次(10,11,12,13,14,1 ...

  6. jvm内存分部

    首先我们必须要知道的是 Java 是跨平台的.java常用的名词有jdk,jre,jvm jdk包括后两者,是开发者工具集, jre表示java运行环境, jvm是java虚拟机,是java夸平台的保 ...

  7. java高并发测试代码

    package com.example.test; import java.net.URL;import java.net.URLConnection;import java.util.concurr ...

  8. UML-6.2-用例-用例模型/用例/场景关系

    参与者:具有某些行为的人或事物.如上一章中的收银员. |_主要参与者:收银员. |_协助参与者:程序(自动付费.帮收银员验证输入要素) |_幕后参与者:政府等(电子签章取证找公证机构) 用例:一组相关 ...

  9. java多线程-ThreadLocal

    大纲: 用法 源码 一.用法 ThreadLocal是一个容器,顾名思义就是把一个变量存到线程本地. class Test { public static void main(String[] arg ...

  10. epoll中epoll_data_t 中fd和ptr的用法

    https://blog.csdn.net/u011123091/article/details/81867078 Linux高性能服务器P152