I am Using an EditText and has onEditorActionListener and TextChangedListener. what i want to do is to search for friends when a text is changed and even search for friend when enter is pressed. But the problem is this tha whenever i enter Text in EditText it automatically hide the keyboard. i want to avoid this. How could i do this??
here is what i am doing
searchET.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId,
KeyEvent event) {
if ((event.getAction() == KeyEvent.ACTION_DOWN) && (actionId == KeyEvent.KEYCODE_ENTER)) {
searchFriendList(searchET.getText().toString());
return true;
}
return false;
}
});
searchET.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before,
int count) { // TODO Auto-generated method stub
if (s.length() > 0)
searchFriendList(searchET.getText().toString());
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) { // TODO Auto-generated method stub
}
@Override
public void afterTextChanged(Editable s) {
}
});
any help would be greatly appreciated.