Can someone with the google dev team explain how to avoid this crash on pre-ics devices? In my case, the ImageButton in the ListView element is a PopupWindow anchor to create a dropdown list. I tried all popup.dismiss (), popup = null, etc., but nothing prevents this from being a problem when the adapter is reset.
I get the following exception:
FATAL EXCEPTION: main java.lang.NullPointerException at android.widget.PopupWindow$1.onScrollChanged(PopupWindow.java:132) 05-21 17:02:27.736: E/AndroidRuntime(25836): at android.view.ViewTreeObserver.dispatchOnScrollChanged(ViewTreeObserver.java:607)
This popup file is in a list item. After removing the last list item from the ListView, I resetAdapter to set the footer. Then, when I move away from the screen, this error occurs.
Not in an Ice Cream Sandwich: An Ice Cream Sandwich. See https://android.googlesource.com/platform/frameworks/base/+/749b0eb2c9a52bb188fd8900859b3725889e0ec0%5E!/
This indicates a fix related to the null anchor PopupWindow. What can be done? In my case, the button in the ListView element is the anchor of the popup. and the same problem here:
https://github.com/JakeWharton/ActionBarSherlock/issues/487
source share