java - How to check if an adapter filter doesn't correspond to any entries in a listview -


does "getfilter().filter();" on simple adapter have way check if listview has particular entry ?

i have code:

string tempstring = searchfield.gettext().tostring();      if (tempstring != "") {          mainactivityfragment.adapter.getfilter().filter(tempstring);          mainactivityfragment.actionbar.setsubtitle("search results");     }      else {          toast.maketext(getactivity().getbasecontext(), "the search field can't empty !", toast.length_short).show();       } 

i'd know if "filter(tempstring);" true (it exists in particular listview). if not maybe prompt user message.

there similar question here may or may not duplicate i'll link here: android - listview filter count.

you can count results after applying filter. unless question knowing before hand; if that's case please edit question specify , can try different solution.


Comments

Popular posts from this blog

php - render data via PDO::FETCH_FUNC vs loop -

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

The canvas has been tainted by cross-origin data in chrome only -