0:设置action为搜索
<EditText
android:paddingLeft="@dimen/px40"
android:id="@+id/et_order_order_search_ordernumber"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/selector_edit"
android:digits="0123456789"
android:hint="请输入快递单号"
android:inputType="number"
android:imeOptions="actionSearch"
android:lines="1"
android:textColorHint="@color/wholesale_tv_acacac"
android:textColor="@color/text_mblack"
android:textSize="@dimen/sp24"
/>
//左上角的订单号输入栏添加监听,如果按了搜索的按钮了那么直接搜索
mEtInputSearchOrderNumber.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
//按下了右下角的搜索,扫描枪测试actionId为0
//输入法显示的时候,actionId=3,就是右下角的按钮的id
if(actionId== EditorInfo.IME_ACTION_SEARCH||actionId==0){
mButtonSearchOrder.callOnClick();
}
return true;
}
});