Android PopupWindow.showAsDropDown报错:BadTokenException: Unable to add window
Android PopupWindow.showAsDropDown报错:
android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
在show之前前,多加一个判断拦截:
Kotlin
你的viewAnchor.windowToken != null