Skip to content

Commit

Permalink
Fix the search bug that not to search when the char input buffer is e…
Browse files Browse the repository at this point in the history
…mpty. Fix the backspace bug when the char input buffer is empty
  • Loading branch information
wanleung committed Mar 2, 2012
1 parent d81bef1 commit 34f907e
Showing 1 changed file with 7 additions and 3 deletions.
Expand Up @@ -248,8 +248,7 @@ private void handleBackspace() {
updateCandidates();
} else if (this.strokecount > 0) {
this.stroktreset();
//getCurrentInputConnection().commitText("", 0);
updateCandidates();
this.setCandidatesViewShown(false);
} else {
this.setCandidatesViewShown(false);
keyDownUp(KeyEvent.KEYCODE_DEL);
Expand All @@ -272,7 +271,12 @@ private void keyDownUp(int keyEventCode) {
}

private void updateCandidates() {
ArrayList<String> words = this.mKeyData.searchRecord(new String(this.charbuffer,0,this.strokecount));
ArrayList<String> words;
if (this.charbuffer.length > 0) {
words = this.mKeyData.searchRecord(new String(this.charbuffer,0,this.strokecount));
} else {
words = new ArrayList<String>();
}
if (words.isEmpty()) {
setCandidatesViewShown(false);
} else {
Expand Down

0 comments on commit 34f907e

Please sign in to comment.