我想在代码中使用ADB
来触发KEYCODE_SEARCH
事件。当我执行这个命令时,我在键盘上看不到任何动作。但是如果我给"adb shell input keyevent KEYCODE_1"
,它就能完美地工作。请给我任何解决方案的火灾搜索事件使用ADB
。
我现在的代码是这样的。
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;
}
});
<EditText android:imeOptions="actionSearch"
android:inputType="text"/>
谢谢。
https://stackoverflow.com/questions/29597445
复制相似问题