public void hideInputManager() { if (mSearchView != null) { if (mImm != null) { mImm.hideSoftInputFromWindow(mSearchView.getWindowToken(), 0); } mSearchView.clearFocus(); SearchHistory.getInstance(this).addSearchString(queryString); } }
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) @Override public boolean onQueryTextSubmit(String query) { InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(searchView.getWindowToken(), 0); searchView.setQuery("", false); searchView.setIconified(false); Toast.makeText(getApplicationContext(), "search 결과", Toast.LENGTH_LONG).show(); return false; }
@Override public boolean onQueryTextSubmit(String query) { Log.d("Sevibus search", "Query submit: " + query); InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(mSearchView.getWindowToken(), 0); if (query.equalsIgnoreCase("virgi")) { ImageView img = new ImageView(this); img.setImageResource(R.drawable.secret); Toast toast = new Toast(this); toast.setView(img); toast.setDuration(Toast.LENGTH_LONG); toast.show(); ThemeSelector.setV(); } return true; }