Caused by: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
发生这个Crash的原因时,应该检查当你为Window添加一个Window的时机是否正确。更改添加时机,比如public void onWindowFocusChanged(boolean hasFocus)
方法中
android.view.WindowManager$InvalidDisplayException: Unable to add window android.view.ViewRootImpl$W@ea68937 -- the specified window type 0 is not valid
发生这个Crash的原因应该是没有指定Window的类型,Window一般有三种类型,分别为 Application windows,Sub-windows,System windows