Code example for SearchView

Methods: getWindowToken

0
			long id) {
		// TODO Auto-generated method stub 
        //DebugUtil.debug("hasfocus--->"+mSearchView.hasFocus()); 
		InputMethodManager imm = (InputMethodManager)getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
        //���������� 
        imm.hideSoftInputFromWindow(mSearchView.getWindowToken(), 0);
 
		mListView.requestFocus();
		mListView.setFocusable(true);
		if (isDrugOrNonDrug) {
			DrugEntity drugEntity=(DrugEntity) mListView.getAdapter().getItem(position);
			addDcAdviceFm.initDrug(drugEntity);
		}else { 
			NonDrugEntity nonDrugEntity=(NonDrugEntity) mListView.getAdapter().getItem(position);
			addDcAdviceFm.initNonDrug(nonDrugEntity);
		} 
	} 
}