Android开发遇到这个错误:
ERROR/AndroidRuntime(247): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
原因:
在传context的时候用了getApplicationContext()
解决办法
传context的时候使用Activity.this
Android开发遇到这个错误:
ERROR/AndroidRuntime(247): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
原因:
在传context的时候用了getApplicationContext()
解决办法
传context的时候使用Activity.this