Unable to add window -- token null is not for an application

导致报这个错是在于new AlertDialog.Builder(mcontext),虽然这里的参数是AlertDialog.Builder(Context context)但我们不能使用getApplicationContext()获得的Context,而必须使用Activity,因为只有一个Activity才能添加一个窗体。 

posted @ 2016-09-16 10:28  newcaoguo  阅读(322)  评论(0编辑  收藏  举报