네이버 검색을 할때 키보드 보면 엔터 말고 검색모양 돋보기가 나타납니다.
그것처럼 구현하고 싶은데 검색 모양 돋보기로 바뀌긴해도 터치하면 검색이 안되네요 ㅠㅠ
android:imeOptions="actionSearch"
etGCNameHint = (EditText)findViewById(R.id.gc_name_hint);
etGCNameHint.setImeOptions(EditorInfo.IME_ACTION_SEARCH);
etGCNameHint.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_SEARCH) {
performSearch();
return true;
}
return false;
}
});
private void performSearch() {
etGCNameHint.clearFocus();
InputMethodManager in = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
in.hideSoftInputFromWindow(etGCNameHint.getWindowToken(), 0);
}