android-控制输入法显示搜索操作而不是输入

android-控制输入法显示搜索操作而不是输入,android,Android,嗨,我正在尝试覆盖IME操作以在虚拟键盘上显示搜索。MyEditText位于放置在活动上的控件中 以下是我所拥有的: <EditText android:id="@+id/txtSearch" android:textSize="18dp" android:textColor="@color/main_text_black" android:layout_width="247dp" android:layout_height="fill_parent"

嗨,我正在尝试覆盖IME操作以在虚拟键盘上显示搜索。My
EditText
位于放置在活动上的控件中

以下是我所拥有的:

<EditText android:id="@+id/txtSearch"
    android:textSize="18dp"
    android:textColor="@color/main_text_black"
    android:layout_width="247dp" 
    android:layout_height="fill_parent"
    android:imeOptions="actionSearch"
    android:gravity="center_vertical"
    android:singleLine="true"
    android:background="@null"
    android:layout_alignParentLeft="true"
    android:layout_marginLeft="38px" />
arg1
当我按enter键时,总是返回为
0
,该键为“未识别”。我也试过不同的键盘,比如sendMessage,但都不起作用。发生什么事了


提前谢谢你

更新到droid 2.2并开始工作。可怕的虫子

您需要在xml文件中指定android:inputType=“text”属性。

基本上,我已经从控件中删除了该属性,并将其添加到活动中,但它仍然无法工作。我也试过发送消息。没有什么!android:imeOptions=“actionSend | FlagNoInteraction”android:inputType=“textShortMessage | textAutoCorrect | textcapSequences | textMultiLine”其类似的输入法被完全禁用或在某些设置中被覆盖。我所做的只是在xml中添加选项,并尝试查看显示的内容。我每次都得到相同的窗口。对虚拟键盘没有任何更改。
@Override
public boolean onEditorAction(TextView view, int arg1, KeyEvent arg2) {
    if((arg1 == EditorInfo.IME_ACTION_SEARCH) {
        for(OnSearchListener listener : _listeners) {
            listener.OnSearch(view, getSearchString());
        }
    }
    InputMethodManager imm = 
        (InputMethodManager)_context.getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.hideSoftInputFromWindow(view.getWindowToken(), 0);

    return false;
}