您的位置:首页 > 其它

编辑信息联系人先输入一个联系人按done,再输入一个数字按删除,删除的是之前的联系人

2016-06-20 17:26 441 查看

编辑信息联系人先输入一个联系人按done,再输入一个数字按删除,删除的是之前的联系人

[DESCRIPTION]

解决“信息编辑界面,主题为空的情况下,点击虚拟键盘上的DEL键,主题框不会消失”问题后,会出现在messaging-》编辑信息-》添加联系人-》先添加一个联系人-》按done-》输入一个数字-》按删除

删除的是之前的联系人。应删除当前数字。

[SOLUTION]

1:修改LatinIME输入法代码中的LatinIME.JAVA

private void sendKeyCodePoint(final int code) {

...

if (Keyboard.CODE_ENTER == code && mTargetApplicationInfo != null ){// modifiy forALPS01285465

// && mTargetApplicationInfo.targetSdkVersion < 16) { //modifiy forALPS01285465

// Backward compatibility mode. Before Jelly bean, the keyboard would simulate

// a hardware keyboard event on pressing enter or delete. This is bad for many

// reasons (there are race conditions with commits) but some applications are

// relying on this behavior so we continue to support it for older apps.

sendDownUpKeyEventForBackwardCompatibility(KeyEvent.KEYCODE_ENTER);

} else {

final String text = new String(new int[] { code }, 0, 1);

mConnection.commitText(text, text.length());

}

......

再修改

private void handleBackspace(final int spaceState) {

......

if (mTargetApplicationInfo != null ){// modifiy forALPS01285465

//&& mTargetApplicationInfo.targetSdkVersion < 16) {// modifiy forALPS01285465

// Backward compatibility mode. Before Jelly bean, the keyboard would simulate

// a hardware keyboard event on pressing enter or delete. This is bad for many

// reasons (there are race conditions with commits) but some applications are

// relying on this behavior so we continue to support it for older apps.

sendDownUpKeyEventForBackwardCompatibility(KeyEvent.KEYCODE_DEL);

} else {

mConnection.deleteSurroundingText(1, 0);

}

最后修改

private void sendKeyCodePoint(){

......

/*if(code>='0'&&code<='9'){ //将这部分code注释掉

...

}*/

......

}

补充说明:

在新建信息,点击收件人图标添加联系人,信息界面删除收件人,无法删除时,

也可以用上面的方法解决。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  虚拟键盘 MTK