Context 对应的Unable to add window 错误记录

近日在使用 AlertDialog时发现一个错误:Unable to add window -- token null is not for an application,从前面观察是无法添加一个新的窗口到这个context,后来想了想前面是用的getApplicationContext()传递过来的context, 看来不能往context中加window吧,就改成了activity.this,代表一个具体的activity了,这样就OK了,记录下以后应该能解决这种添加新窗口传递context的问题