android OnEditorActionListener无法使用自定义软键盘

时间:2013-04-16 16:29:34

标签: android android-softkeyboard

我正在开展一个需要使用由其他人开发的自定义软键盘的项目。问题是setOnEditorActionListener在使用片段的特定窗口中不起作用。不起作用意味着根本不会触发onEditorAction。问题只出现在自定义键盘上,默认情况下每个东西都运行良好。问题是软键盘项目非常复杂,因为我不知道软键盘逻辑,我需要在tomoroow早上之前解决问题。有没有人知道这种行为?请帮忙

这是我设置监听器的部分,这个代码在项目周围工作但是在这里,甚至没有达到第一个监听器的行

((EditText) getView().findViewById(R.seatDetailCommonHeader.txtName)).setOnEditorActionListener(new OnEditorActionListener() {

                    @Override
                    public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
                        if (event != null && event.getAction() != KeyEvent.ACTION_DOWN) {
                            return true;
                        }


                        // KeyboardHelper.setKeyboardVisibilty(v, false);
                        executeCheck();

                        return true;

                    }
                });

我进行了进一步的调查,我在键盘代码中的每个方法的第一行设置了一个断点(这是从sdk示例中获取的一个只有一些布局修改)和两个不同活动中的相同EditText触发不同的方法:

在一种情况下(工作单位)单击操作按钮时会触发此方法:

LatinKeyboard.isInside
LatinKeyboard.isInside
LatinKeyboard.isInside
LatinKeyboard.isInside
LatinKeyboard.isInside
LatinKeyboard.isInside
LatinKeyboard.isInside
LatinKeyboard.isInside
LatinKeyboard.isInside
SoftKeyboard.onKey
SoftKeyboard.isWordSeparator
SoftKeyboard.sendKey
SoftKeyboard.keyDownUp
SoftKeyboard.keyDownUp
SoftKeyboard.updateShiftKeyState

在另一种情况下(不工作的那个)触发相同的方法,加上这些:

SoftKeyboard.onFinishInput
SoftKeyboard.onStartInput
SoftKeyboard.updateShiftKeyState
LatinKeyboard.setImeOptions
SoftKeyboard.onStartInputView

希望有人对这种行为有所了解,因为我真的遇到了麻烦

0 个答案:

没有答案