What I have currently
- I am using a editText
- On clicking of editttext keyboard pops up
- Now I use keyboard to type
What I am trying to achieve:
- On click of search icon on keyboard I want to close the keyboard
- On click of recommendation shown on keyboard words for edit text how to close the keyboard
What I am able to achieve: On click of search icon on keyboard I want to close the keyboard
getSearchView().setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_SEARCH) {
hidekeyBoard(context,v);
return true;
}
return false;
}
});
What I am not able to achieve: On click of recommendation shown on keyboard words for edit text how to close the keyboard