android - Unable to filter a listview with 2 lines -


I'm trying to provide a searchable index view. Each list has a name & amp; Address text box, but I only want to filter by name. My current code does not do anything, so there is no filtering at all. Is there a way to set up a column to filter?

  // class variable private synchronizer adapter mAdapter; Private Editing Text FiltersText = Faucet; @ Override Protected Zero (InstanceStat saved from bundle) {// Todo auto-generated method stub super. Connet (Saved Instantstate); SetContentView (R.layout.add_customer_listview); // listViewCustomers = (ListView) findViewById (R.id.list); BuildingListViewAdaptor (); SetListAdapter (mAdapter); Set // filter filters the Text = (editable text) Duँdenwubiaiaidi (Arkaidksrc_boks); FilterText.addTextChangedListener (filterTextWatcher); } Private TextWatcher filterTextWatcher = new TextWatcher () {public void beforeTextChanged (CharSequence s, int start, int count, after rounding) {} public void onTextChanged (CharSequence s, int start, before int, int count) {MAdapterkgetFilter () .filter (s); Log D. (GlobalTool: Eracodes.info, "SearchText =" + S.StustString ()); } Public since no text (replace qualified ARB0) {// TODO Auto-generated method stub}}; Private Zero buildingListViewAdaptor () {// 1. Get the DataList CustomerLocationDataHandler clDataHandler = New CustomerLocationDataHandler (getContentResolver ()); Cursor cursor = clDataHandler.allCustomerLocations (); ClDataHandler = Null; // 2. Adapter mAdapter = Create new SimpleCaptor Adapter (this, R. layout.list_litem_font_font, // list_item_custom_font cursor, new string [] {MyobiliseData.Columns_CustomerLocations.CUSTOMER_NAME, MyobiliseData.Columns_CustomerLocations.CITY}, New Ent [] {R.id.text1, R.D.Text 2}); }    

Check this post:

I have been involved in a similar method and it is working.

Comments