编辑信息联系人先输入一个联系人按done,再输入一个数字按删除,删除的是之前的联系人
时间:10-02
整理:3721RD
点击:
[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注释掉
...
}*/
......
}
补充说明:
在新建信息,点击收件人图标添加联系人,信息界面删除收件人,无法删除时,
也可以用上面的方法解决。
解决“信息编辑界面,主题为空的情况下,点击虚拟键盘上的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注释掉
...
}*/
......
}
补充说明:
在新建信息,点击收件人图标添加联系人,信息界面删除收件人,无法删除时,
也可以用上面的方法解决。