Caused by: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
發(fā)生這個Crash的原因時滋早,應(yīng)該檢查當(dāng)你為Window添加一個Window的時機(jī)是否正確掂僵。更改添加時機(jī)签夭,比如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
發(fā)生這個Crash的原因應(yīng)該是沒有指定Window的類型湿镀,Window一般有三種類型,分別為 Application windows,Sub-windows,System windows