PopupWindow $BadTokenException: Unable to add window ― token null is not valid
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have the following error when showing a PopupWindow. The errors are triggered by the line: checkInPopup . showAtLocation (( ViewGroup ) mapView . getParent (), Gravity . CENTER_HORIZONTAL , 0 , 0 ); mapView is a MapView and nothing is null. The stacktrace: 01 - 08 18 : 00 : 09.402 : E / AndroidRuntime ( 27768 ): Caused by : android . view . WindowManager$BadTokenException : Unable to add window -- token null is not valid ; is your activity running ? 01 - 08 18 : 00 : 09.402 : E / AndroidRuntime ( 27768 ): at android . view .