Search functionality in Android Custom ListView
I have CursorAdapter to show data from database. Now, I want add search
functionality to custom listview. So, I tried with this. but, this is not
working.
searchOption.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence cs, int start, int
before, int count) {
// TODO Auto-generated method stub
AbstractActivity.this.cursorAdapter.getFilter().filter(cs);
}
@Override
public void beforeTextChanged(CharSequence s, int start, int
count, int after) {
// TODO Auto-generated method stub
}
@Override
public void afterTextChanged(Editable s) {
// TODO Auto-generated method stub
}
});
I will be glad if you guys help to find out what's the problem in my code
or how can i add search functionality to a custom listview.
No comments:
Post a Comment