Searching a custom list view in android? <p>I am using a custom list view and I get unexpected results on search.I would ideally like to search on particular columns in the list for example I would like to search on a Invoice number or a contact number or by name of the person. The following is my code.</p> <pre><code> public void showJson(String json) { final Context billsctx = getActivity(); ParseBills pb = new ParseBills(json); pb.parseJSON(); bl = new BillsCustomList((Activity) billsctx, ParseBills.doc_no, ParseBills.date, ParseBills.cust_name, ParseBills.cust_number, ParseBills.item_count, ParseBills.total_wt, ParseBills.total,ParseBills.balance, ParseBills.bill_type); all_listView.setAdapter(bl); inputSearch.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { bl.getFilter().filter(s); } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } @Override public void afterTextChanged(Editable s) { if (s.length()==0) { refreshFragment(); } } }); </code></pre> <p>}</p> <p>This is my adapter code.</p> <pre><code>public class BillsCustomList extends ArrayAdapter&lt;String&gt; { private String[] doc_no; private String[]date; private String[] cust_name; private String[] cust_number; private String[] item_count; private String[]total_wt; private String[]total; private String[]balance; private String[]bill_type; private Activity context; public BillsCustomList(Activity context, String[] doc_no, String[] date, String[] cust_name,String[] cust_number,String[] item_count,String[] total_wt,String[] total,String[] balance,String[] bill_type) { super(context, R.layout.bills_list_view, doc_no); this.context =context; this.doc_no=doc_no; this.date = date; this.cust_name = cust_name; this.cust_number = cust_number; this.item_count= item_count; this.total_wt = total_wt; this.total = total; this.balance = balance; this.bill_type = bill_type; } @Override public View getView(int position, View convertView, ViewGroup parent) { LayoutInflater inflater = context.getLayoutInflater(); View listViewItem = inflater.inflate(R.layout.bills_list_view, null, true); TextView textViewDocno = (TextView) listViewItem.findViewById(R.id.textViewInvNo); TextView textViewDt = (TextView) listViewItem.findViewById(R.id.textViewDt); TextView textViewName = (TextView) listViewItem.findViewById(R.id.textViewName); TextView textViewNumber = (TextView) listViewItem.findViewById(R.id.textViewNumber); TextView textViewCount = (TextView) listViewItem.findViewById(R.id.textViewCount); TextView textViewTotwt = (TextView) listViewItem.findViewById(R.id.textViewTotwt); TextView textViewTot = (TextView) listViewItem.findViewById(R.id.textViewTot); TextView textViewBal = (TextView) listViewItem.findViewById(R.id.textViewBalanace); TextView textViewBt = (TextView) listViewItem.findViewById(R.id.textViewBt); textViewDocno.setText(doc_no[position]); textViewDt.setText(date[position]); textViewName.setText(cust_name[position]); textViewNumber.setText(cust_number[position]); textViewCount.setText(item_count[position]); textViewTotwt.setText(total_wt[position]); textViewTot.setText(total[position]); textViewBal.setText(balance[position]); textViewBt.setText(bill_type[position]); return listViewItem; } } </code></pre> <p>How can I achieve it? Any suggestion or help is appreciated.Thank You.</p>