Android contact filter not working
<p>I got some sample code and i wanted to add search filter on it, after you type any letter to filter it won't show the filtered contacts or it won't update the listview, can anyone say something on it, thanks.</p>

<pre><code>   import ........

   ContactAdapter objAdapter;
   private ListView listView;
   EditText inputSearch;
   private List&lt;ContactBean&gt; list = new ArrayList&lt;ContactBean&gt;();

    @Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);       

listView = (ListView) findViewById(R.id.list);
listView.setOnItemClickListener(this);
    inputSearch = (EditText) findViewById(R.id.inputSearch);
    listView = (ListView) findViewById(R.id.list);

    Cursor phones = getContentResolver().query(
            ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, null, null, null);
    while (phones.moveToNext()) {
        String name = phones.getString(phones           .getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME));

        String phoneNumber = phones.getString(phones                            .getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));

        ContactBean objContact = new ContactBean();
        objContact.setName(name);
        objContact.setPhoneNo(phoneNumber);         
        list.add(objContact);

    }
    phones.close();

   objAdapter = new ContactAdapter(MainActivity.this, R.layout.alluser_row, list);
   listView.setAdapter(objAdapter);
      if (null != list &amp;&amp; list.size() != 0) {
        Collections.sort(list, new Comparator&lt;ContactBean&gt;() {

            @Override
            public int compare(ContactBean lhs, ContactBean rhs) {
                return lhs.getName().compareTo(rhs.getName());
            }
        });
       } else {
    showToast("No Contact Found!!!");
 }

    inputSearch.addTextChangedListener(new TextWatcher() {

    @Override
    public void onTextChanged(CharSequence cs, int arg1, int arg2, int arg3) {
        // When user changed the Text
        MainActivity.this.objAdapter.getFilter().filter(cs);
    }

    @Override
    public void beforeTextChanged(CharSequence arg0, int arg1, int arg2, int arg3)                   {
        // TODO Auto-generated method stub   
    }

    @Override
    public void afterTextChanged(Editable arg0) {
        // TODO Auto-generated method stub
    }
});
  }
</code></pre>
