How can I hide tabs while scrolling down a ListView then show them again if the user scrolls up?
<p>I want to make the tabs of a tabhost fade up if the user is scrolling down a listview</p>

<p>I have the following code but it does not work</p>

<pre><code>ListView ls = (ListView) findViewById(R.id.list);
        ls.setOnScrollListener(new OnScrollListener() {
            public void onScrollStateChanged(AbsListView view, int scrollState) {

            }
            int previousVisible = 3;
            public void onScroll(AbsListView view, int firstVisibleItem,
                    int visibleItemCount, int totalItemCount) {
                if (previousVisible &lt; firstVisibleItem) {
                    getParent().findViewById(android.R.id.tabhost)
                            .setVisibility(View.INVISIBLE);
                } else {
                    getParent().findViewById(android.R.id.tabhost)
                            .setVisibility(View.VISIBLE);
                }
                previousVisible = firstVisibleItem;
            }
        });
</code></pre>
