android.view.WindowManager$BadTokenException: Unable to add window

来源:互联网 发布:sparklehorse知乎 编辑:程序博客网 时间:2024/05/22 14:21
错误日志:android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application

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



解决:子Activity启动dialog(或类似操作)引发此错误
解决方法:
AlertDialog.Builder(xxx.this) => 
AlertDialog.Builder(this.getParent()) 
或(this)改为(xxx.this)


0 0