键盘上显示search并响应

在输入框画的焦点后弹出对话框能显示 查找点击并可以进行搜索

<EditText android:imeOptions="actionSearch" /> 
然后

editText.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; 
   
} 
}); 

你可能感兴趣的:(android)