Android Spinner make several rows invisible
<p>I have a Expandable List View with a Custom Adapter. With a Spinner, a User can select if he only wants to see specific entries. If he selects something, I want to make every other row that doesnt match his request invisible/gone.</p>

<p>I tried this inside my ListViewAdapters getChildView()</p>

<pre><code>    if (special == 0 || special == Integer.parseInt(home) || special ==   Integer.parseInt(next)) {

        return convertView;
    } else {
         convertView.setVisibility(View.GONE);
        return convertView;
    }
</code></pre>

<p>Unfortunately, it doesnt seem to work. The integer special indicates the selected Item in the Spinner, but I only get an "empty" ListView with all rows in it being empty. So they obviously arent GONE. The problem is that even those rows who fulfill the if-statement arent visible.... anyone knows a better approach?</p>

<p>Thanks in advance</p>