public UnitSearchItem getItem(int position) { return mArrayAdapter.getUnitSearchItem(position); }
@SuppressWarnings("unchecked") @Override protected void publishResults(CharSequence constraint, FilterResults results) { mArrayList = (ArrayList<UnitSearchItem>) results.values; // has the filtered values notifyDataSetChanged(); // notifies the data with new filtered values }
builder.setView(layout); mArrayAdapter = new FilterAdapter(context, mOriginalList); mArrayAdapter.registerDataSetObserver(new DataSetObserver() {
public void onTextChanged(CharSequence s, int start, int before, int count) { // use Filter to filter results so filtering actions don't // operate on the UI thread arrayAdapter.getFilter().filter(s.toString()); } });
builder.setView(layout); final FilterAdapter arrayAdapter = new FilterAdapter(context, arrayToFilter);
public void onTextChanged(CharSequence s, int start, int before, int count) { // The IdlingResource is null in production. if (idlingResource != null) { idlingResource.setIdleState(false); } // use Filter to filter results so filtering actions don't // operate on the UI thread mArrayAdapter.getFilter().filter(s.toString()); } });