@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);
   }
 }
Exemplo n.º 2
0
  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;