TabHost嵌套中Dialog的错误

错误:
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的话,就会引发此错误。在1.5上.

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




来自: http://hi.baidu.com/webtalk/blog/item/74ac84cb5125e4f353664fe6.html

你可能感兴趣的:(dialog,token)