android - Filter Hashmap with Text/Image Key/Value pair on AutoCompleteTextView -


i trying filter out results not start text entered in autocompletetextview textbox. initial hashmap gets loaded via asynctask runs in background once program loads. here performfilter code:

   try{                      // note clone - original list gets stripped                     for(iterator<map.entry<string, string>> = datatosearch.entryset().iterator(); it.hasnext();)                     {                         map.entry<string, string> entry = it.next();                         string lowercase = entry.getvalue().tolowercase();                            if(lowercase.startswith(constraint.tostring().tolowercase()))                             searchmap.put(entry.getkey(), entry.getvalue());                             it.remove();                      }                  }catch (exception e){                     log.d("hus","exception "+e);                 }                 filterresults filterresults = new filterresults();                 filterresults.values = searchmap;                 filterresults.count = searchmap.size(); 

my issue either of results initial hashmap show or none of results show up. might doing wrong? async task calls adapter.notifydatasetchanged when initial hashmap changes still think filter results based on text in textview starts with. appreciated.


Comments