title: Hide footer view in ListView?
body: <p>I have a <code>ListView</code>. The data behind it is fetched from the Internet, in sets of 10-30 items whenever the user scrolls all the way to the bottom. In order to indicate that it is loading more items, I used <a href="http://d.android.com/reference/android/widget/ListView.html" rel="noreferrer"><code>addFooterView()</code></a> to add a simple view that displays a "Loading..." message and a spinner. Now, when I'm out of data (no more data to fetch), I want to hide that message. I tried to do:</p>
  
  <pre><code>loadingView.setVisibility(View.GONE);
  </code></pre>
  
  <p>Unfortunately, while that does hide the view, it leaves space for it. I.e. I end up with a big blank space where the "Loading" message used to be. How can I go about properly hiding this view?</p>
  
  <p>I can't use <code>removeFooterView()</code> because I may need to show it again, in which case I can't call <code>addFooterView()</code> again because an adapter has already been set on the <code>ListView</code>, and you can't call <code>addHeaderView()</code> / <code>addFooterView()</code> after setting an adapter.</p>