title: Null Pointer When Removing Footer from ListView?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/11126422/crash-on-listview-removefooterviewview">Crash on ListView.removeFooterView(View)</a>  </p>
  </blockquote>
  
  
  
  <p>How is it possible to get a null pointer exception when removing an footerview?  I checked that both the footerview and listview are not null before calling</p>
  
  <pre><code>myListView.removeFooterView(mFooterView)
  </code></pre>
  
  <p>This listview does have a multi-list adapter.  I also checked the parent of every footer that could have been added and the parent of each one was null.</p>
  
  <p>BTW, where on earth is the getAllFooterViews?  hasFooterView(footerView)? methods in the SDK.</p>
  
  <p>PS.  I don't think a well written API should ever hide such information.</p>
  
  <pre><code>  FATAL EXCEPTION:  main
    java.lang.NullPointerException
    at android.widget.ListView.removeFooterView(ListView.java:461)
    at com.mypackage.MyActivity.clearAllFooters()
  </code></pre>
  
  <p>It does not seem to matter which footer.  Its really anything I try to remove at this point, any of the four footers that might have been added.</p>
  
  <p>A bit of context, the ListView is not currently visible, does have focus, and the footer is being cleared after the return of an Async call.  I have three listviews on the same MyActivity, and this ListView is not currently visible, it does not have the focus, but still a null pointer exception?</p>
  
  <p>I am compiling 4.03 and deploying on android sdk 2.2</p>
  
  <p>I am also checking that footer count is greater than 0.</p>