如何通过 android 自定义键盘操作按钮执行搜索操作?

How to perform a search action by android custom keyboard action button?

我正在开发 android 自定义键盘。我需要执行搜索操作,根据用户选择的文本字段将光标移动到下一个文本字段操作。如何执行这些操作?

我找到答案了

getCurrentInputConnection().performEditorAction(EditorInfo.IME_ACTION_GO);
getCurrentInputConnection().performEditorAction(EditorInfo.IME_ACTION_SEARCH);
getCurrentInputConnection().performEditorAction(EditorInfo.IME_ACTION_NEXT);