@Override
 protected void performFiltering(CharSequence text, int start, int end, int keyCode) {
   if (start < prefix.length()) {
     start = prefix.length();
   }
   Filter filter = getFilter();
   if (filter != null) {
     filter.filter(text.subSequence(start, end), this);
   }
 }
  public void doFilter(Uri uri, String filterString) {
    if (!uri.equals(mUri)) {
      mUri = uri;

      Cursor contactCursor = runQuery(filterString);

      if (mContactAdapter == null) {
        mContactAdapter = new ContactAdapter(mContext, contactCursor);
        mFilter = mContactAdapter.getFilter();
        mFilterList.setAdapter(mContactAdapter);
      } else {
        mContactAdapter.changeCursor(contactCursor);
      }

      // contactCursor.close();

    } else {
      mFilter.filter(filterString);
    }
  }
 public void onTextChanged(CharSequence s, int start, int before, int count) {
   Log.d(TAG, "filtering + " + s);
   Filter filter = mAdapter.getFilter();
   filter.filter(s);
 }
 public void doFilter(String filterString) {
   mFilter.filter(filterString);
 }
package com.lib.custom.widget;
 boolean filterIncludesItem(T graphObject) {
   return filter == null || filter.includeItem(graphObject);
 }