Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Filter getFilter() {
- return new Filter() {
- @Override
- protected FilterResults performFiltering(CharSequence constraint) {
- final FilterResults oReturn = new FilterResults();
- final ArrayList<Info_Filter> results = new ArrayList<Info_Filter>();
- if (orig == null)
- orig = items;
- if (constraint != null) {
- if (orig != null & orig.size() > 0) {
- for (final Info_Filter g : orig) {
- if (g.getName().toLowerCase().contains(constraint.toString()))
- results.add(g);
- }
- }
- oReturn.values = results;
- }
- return oReturn;
- }
- @Override
- protected void publishResults(CharSequence constraint, FilterResults results) {
- items = (ArrayList<Info_Filter>) results.values;
- notifyDataSetChanged();
- }
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement