改變鍵盤上的回車變爲搜索按鈕
有的事一個放大鏡有的會顯示成搜索兩個字
etSearch.setImeOptions(EditorInfo.IME_ACTION_SEARCH);//設置搜索屬性
//監聽按下的操作
etSearch.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId==EditorInfo.IME_ACTION_SEARCH){
if (TextUtils.isEmpty(v.getText().toString())){
UITipDialog.showFall(ExhibitionCenterActivity.this,”請輸入要搜索內容”);
return true;
}
mRefreshHelper.onDefaluteMRefresh(true);
}
return true;
}
});