使用​​AlertDialog​​时报错


Caused by: android.view.WindowManager$BadTokenException: Unable to add window – token null is not valid; is your activity running?


解决:

​AlertDialog​​的Context参数应该为: ​​xxxActivity.xxx​

android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid;_sed

这是我的主程序,所以我的​​Context​​应该是​​B000Activity.b000​