I have a simple question:
I have a Listview Data with these strings:
String words[] = {
"man",
"guy",
"penny-wise",
"(just)",
I added a search funciontality to Listview, like this:
* Enabling Search Filter
* */
search.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence cs, int arg1, int arg2, int arg3) {
// When user changed the Text
Words.this.adapter.getFilter().filter(cs); {
lv.setOnItemClickListener(new OnItemClickListener(){
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
}
});
}
}
@Override
public void beforeTextChanged(CharSequence arg0, int arg1, int arg2,
int arg3) {
// TODO Auto-generated method stub
}
@Override
public void afterTextChanged(Editable arg0) {
// TODO Auto-generated method stub
}
});
}
So, the search functionality works well, but I want to this recognize when I am typing a part of the ceratin word from string (listview data) as "wise" from penny-wise item, they don't offer penny-wise as a suggestion that it should be (because it is exist in listview data)
If I type JUST they don't offer as suggestion... because there is a ( ) in my string...
How can I solve this. I am newbie. Thanks!!!