AutoCompleteTextView in ListView
<p>I have got a <code>ListView</code> contains info about radio stations. It consists of several custom items (<code>TextView</code> + <code>CheckBox</code>) and embedded <code>AutoCompleteTextView</code> at the top. My problem is that I implemented getView() method of <code>ListView's</code> <code>Adapter</code> probably incorrect, because It scrolls up and down well only if I don't select <code>AutoCompleteTextView</code>, because after that action I get NullPointerException. To be clearer, here is a snippet of my Custom Adapter code:</p>

<pre><code>class ImageAdapter extends ArrayAdapter&lt;RadioStations&gt; {

    private Activity a;
    private LayoutInflater inflater;
    private View searchView; 
    private ArrayAdapter&lt;RadioStation&gt; mAdapter;

    public ImageAdapter(Activity act, RadioStation[] objects) {
        super(act, 0, objects);
        a = act;
        inflater = (LayoutInflater) a.getSystemService(LAYOUT_INFLATER_SERVICE);
        mAdapter = new ArrayAdapter&lt;RadioStation&gt;(RadioStationListActivity.this, android.R.layout.simple_dropdown_item_1line, mStations);
    }


    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        Log.i(TAG, "GETTING VIEW[" + position + "]");
        final TextView NameOfStation;
        CheckBox FavouriteFlag;

        if(position == 0) {
            Log.d(TAG, "Making AutoCompleteTextView");
            searchView = inflater.inflate(R.layout.search_view, null);
            ((AutoCompleteTextView)searchView.findViewById(R.id.Seacrh_field)).setAdapter(mAdapter);
            ((AutoCompleteTextView)searchView.findViewById(R.id.Seacrh_field)).setOnItemClickListener(
                new OnItemClickListener() {

                    @Override
                    public void onItemClick(AdapterView&lt;?&gt; parent, View v,  int position, long id) {                            
                        ...
                    }
                }
            );
            searchView.setFocusable(true);
            return searchView;
        }
        if(convertView == null || convertView == searchView){
            Log.w(TAG, "Convert view is null");
            convertView = inflater.inflate(R.layout.radio_list_item, null);                 
        }   

        final RadioStation station = getItem(position-1);

        NameOfStation = (TextView) convertView.findViewById(R.id.name_of_chanel);
        FavouriteFlag = (CheckBox) convertView.findViewById(R.id.favorite);

        if(NameOfStation == null)
            Log.d(TAG, "Name of station is null!!!!!!!!!");
        NameOfStation.setText(station.toString());
        FavouriteFlag.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                ...
            }
        });

        FavouriteFlag.setFocusable(false);


        return convertView;
    }
</code></pre>

<p>}</p>

<p>So if anybody see my misstake I would be glad to take your advice. By the way I get NullPointerException when I try to put text into <code>NameOfStation</code> and It`s because convertView remain to be search view despite on condition </p>

<p><code>if(convertView == null || convertView == searchView)
                          convertView = inflater.inflate(R.layout.radio_list_item, null);</code></p>
