android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an appli

08-01 06:58:20.188 9791-9791/com.wlkj.ciyun E/AndroidRuntime: FATAL EXCEPTION: main
                                                              Process: com.wlkj.ciyun, PID: 9791
                                                              android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
                                                                  at android.view.ViewRootImpl.setView(ViewRootImpl.java:543)
                                                                  at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:259)
                                                                  at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
                                                                  at android.app.Dialog.show(Dialog.java:286)


写Dialog时候 运行报错,这个其实是我们使用上下文错误 ,这里必须使用this或activity.this  而不能使用getBaseContext ();

你可能感兴趣的:(错误)