xabad / AndroidProblemSolutionCollection

AndroidProblemSolutionCollection
0 stars 0 forks source link

not attached to window manager #1

Open xabad opened 4 years ago

xabad commented 4 years ago
android.view.WindowManagerGlobal.findViewLocked(WindowManagerGlobal.java:385)
android.view.WindowManagerGlobal.removeView(WindowManagerGlobal.java:311)
android.view.WindowManagerImpl.removeViewImmediate(WindowManagerImpl.java:89)
android.widget.PopupWindow.dismiss(PopupWindow.java:1472) 
xabad commented 4 years ago

validateActivity

fun Context?.validateActivity():Boolean {
    return this != null && this is Activity && !this.isFinishing && !this.isDestroyed
}
        if(context.validateActivity()) {
            popupWindow.dismiss()
        }