title: Android SDK Crash at android.widget.PopupWindow$1.onScrollChanged(PopupWindow.java:132)
body: <p>Can someone with google dev team explain how to avoid this crash on pre-ics devices?  In my case an ImageButton on the ListView item is the anchor of the PopupWindow to create a dropdown. I have tried everything popup.dismiss() , popup= null, etc  but nothing seems to prevent this being an issue when the adapter is reset.</p>
  
  <p>I am getting the following exception:</p>
  
  <pre><code> 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)
  </code></pre>
  
  <p>This Popup is on a list item. Once the last list item is removed from the ListView I resetAdapter to set a footer.  Then when I move away from the screen this error occurs.</p>
  
  <p>Not in Ice Cream Sandwich:  Icecream Sandwich. See <a href="https://android.googlesource.com/platform/frameworks/base/+/749b0eb2c9a52bb188fd8900859b3725889e0ec0%5E!/" rel="nofollow">https://android.googlesource.com/platform/frameworks/base/+/749b0eb2c9a52bb188fd8900859b3725889e0ec0%5E!/</a></p>
  
  <p>This suggests a fix related to null anchor of PopupWindow.  What can be done?
  In my case a button in ListView item is the anchor  of the popup window.
  and same issue here:</p>
  
  <p><a href="https://github.com/JakeWharton/ActionBarSherlock/issues/487" rel="nofollow">https://github.com/JakeWharton/ActionBarSherlock/issues/487</a></p>