issues with custom filter for ListView with ArrayAdapter
<p>i have a arraylist with custom objects.</p>

<pre><code>public class Info implements Serializable {

public String name;
public int Type; 
public long start; 
</code></pre>

<p>}</p>

<p>and i am using it in this way</p>

<pre><code> public class myLogAdapter extends ArrayAdapter&lt;Info&gt; implements Filterable {
    ArrayList&lt;Info&gt; items;
    ArrayList&lt;Info&gt; searchitems;
     Context context;
     private Filter filter;
    public myLogAdapter(Context context, int listView,
            ArrayList&lt;Info&gt; List) {
        super(context, listView, List);
        // TODO Auto-generated constructor stub
        this.items = new ArrayList&lt;Info&gt;(List);
        this.searchitems = new ArrayList&lt;Info&gt;();
         this.context = context;
    }
    @Override
    public Filter getFilter()
    {
        if (filter == null)
            filter = new NameFilter();

        return filter;
    }

    private class NameFilter extends Filter
    {
        @Override
        protected FilterResults performFiltering(CharSequence constraint) {
            FilterResults results = new FilterResults();
            if(constraint == null || constraint.length() == 0) {
                //ArrayList&lt;Info&gt; list = new ArrayList&lt;Info&gt;(searchitems);
                results.values = items;
                results.count = items.size();
            } else {
                ArrayList&lt;Info&gt; newValues = new ArrayList&lt;Info&gt;();
                for(int i = 0; i &lt; items.size(); i++) {
                    Info item = items.get(i);
                    if(item.name.toLowerCase().startsWith(constraint.toString().toLowerCase())) {
                        newValues.add(item);
                    }
                }
                results.values = newValues;
                results.count = newValues.size();
            }       
            return results;
        }

        @SuppressWarnings("unchecked")
        @Override
        protected void publishResults(CharSequence constraint, FilterResults results) {

            searchitems = (ArrayList&lt;Info&gt;) results.values;
            notifyDataSetChanged();

        }

    }
</code></pre>

<p>}</p>

<h2>calling it like this -></h2>

<pre><code>LogAdapter.getFilter().filter(query);
</code></pre>

<p>But this is not filtering the list.On filtering the list showing all the result not the sorted one.Please help me figure out what is the problem.</p>

<p>Thanks</p>
