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

本文介绍了解决信息编辑界面中删除操作导致的错误问题,包括修改LatinIME输入法代码的具体步骤,确保输入数字后能正确删除当前数字而非之前添加的联系人。

编辑信息联系人先输入一个联系人按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注释掉
...
}*/
......
}
补充说明:
在新建信息,点击收件人图标添加联系人,信息界面删除收件人,无法删除时,
也可以用上面的方法解决。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值