error : The method getFilter() is undefined for the type FriendsActivity.ListAdapter
<p>Trying to implement search functionality in list view having problem in search,here i am placing code where i am getting error</p>

<pre><code> friendsearch.addTextChangedListener(new TextWatcher() {
     public void onTextChanged(CharSequence cs, int arg1, int arg2, int arg3) {
                    // When user changed the Text
                    FriendsActivity.this.adapter.getFilter().filter(cs);
                    //*in the above line i am getting error.*
       }

         public void beforeTextChanged(CharSequence arg0, int arg1, int arg2,
                int arg3) {
            // TODO Auto-generated method stub

        }

        public void afterTextChanged(Editable arg0) {
            // TODO Auto-generated method stub
        }
    });
</code></pre>
