title: How to implement filter search for listAdapter?
body: <p>adapter.getFilter().filter(s);Hi i looked through and research alot on how to implement filter search and i still cant get mine working. Currently im using listadapter with hashmap to display listview. Now how do i use the listadapter to do search function? Below is my code:</p>
  
  <pre><code>private ListAdapter adapter;
  ArrayList&lt;HashMap&lt;String, String&gt;&gt; eventsList;
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
        setContentView(R.layout.homepage);
        searchBar.addTextChangedListener(filterTextWatcher);
  
  // HashMap for ListView
  eventsList = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
  adapter = new SimpleAdapter(HomepageActivity.this, eventsList,
  R.layout.list_event, new String[] { TAG_EID, TAG_ENAME, TAG_CNAME, TAG_CREATED_AT },
  new int[] { R.id.eid, R.id.ename, R.id.cname, R.id.created_at });
  
  // updating listView
  setListAdapter(adapter);
  }
  private TextWatcher filterTextWatcher = new TextWatcher() { 
  
      public void afterTextChanged(Editable s) { 
      } 
  
      public void beforeTextChanged(CharSequence s, int start, int count, 
              int after) { 
      } 
  
      public void onTextChanged(CharSequence s, int start, int before, 
              int count) { 
          adapter.getFilter().filter(s);&lt;--- THIS IS WHERE I GOT ERROR
      } 
  
  }; 
  
  @Override 
  protected void onDestroy() { 
      super.onDestroy(); 
      searchBar.removeTextChangedListener(filterTextWatcher); 
  }
  </code></pre>