首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

Unable to add window is not valid; is your activity running? 解决集锦

2012-07-04 
Unable to add windowis not valid is your activity running? 解决汇总http://androiddeveloper.diandia

Unable to add window is not valid; is your activity running? 解决汇总
http://androiddeveloper.diandian.com/post/2011-07-11/2817890
引用郁闷的Bug,终于解决了,分享一下解决方案!

错误:
android.view.WindowManager$BadTokenException: Unable to add window -- token android.app.LocalActivityManager$LocalActivityRecord@435def20 is not valid; is your activity running? at android.view.ViewRoot.setView......

发生环境:
在一个tabActivity里面嵌套一个tabAcitivity, 如果在子tabActivity里面显示AlertDialog的话,就会引发此错误。

解决方法:
AlertDialog.Builder(xxx.this) => AlertDialog.Builder(this.getParent())

http://androiddada.iteye.com/blog/1243273

热点排行