为什么“无法添加窗口 - 令牌无效”异常来了?

时间:2011-10-20 09:53:36

标签: android webview

android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@43e64670 is not valid; is your activity running?

当我尝试显示一个对话框时,我收到此异常。为什么会这样?

1 个答案:

答案 0 :(得分:1)

Dialog dialog = new Dialog(Myactivity.this);

如果你有tabGroupactivity ......

Dialog dialog = new Dialog(Myactivity.this.getParent());