Hi I want to add A search widget to my Android app like Whatsapp where in user Clicks a Search button And User is presented The result... I have already implemented the search logic in my custom listview , Now I want to Separate my Search logic and Listview Logic ... Things I am missing is when no user is found show A screen saying no user and also implement the search button in ActionBar
Below is my code for search logic...
EditText editTxt = (EditText) findViewById(R.id.inputSearch);
// <To Implement No results Found>
editTxt.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (count < before) {
// We're deleting char so we need to reset the adapter data
bindingData.resetData();
}
bindingData.getFilter().filter(s.toString());
}
/*Auto Generated Methods */
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
}
@Override
public void afterTextChanged(Editable s) {
}
});