i want to put \"Go\" button in android appliation softkeyboard
for search and other related scenarios can any one guide me how to achieve this? with example.
any
I used
android:imeOptions="actionGo"
and to handle go action I ma using
etSearch.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_GO || actionId == EditorInfo.IME_ACTION_DONE) {
//your functionality
// hide virtual keyboard
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(etSearch.getWindowToken(), InputMethodManager.RESULT_UNCHANGED_SHOWN);
return true;
}
return false;
}
});