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