Code example for InputConnection

Methods: beginBatchEditendBatchEdit

0
    } 
 
    public void onText(CharSequence text) {
        InputConnection ic = getCurrentInputConnection();
        if (ic == null) return;
        ic.beginBatchEdit();
        ic.commitText(text, 0);
        ic.endBatchEdit();
    } 
 
    public void onSpecialKey(int keyCode, KeyEvent event) {
        getCurrentInputConnection().sendKeyEvent(event);
        // handle backspace etc here 
    } 
     
    public void setSuggestions(List<String> suggestions, boolean completions,
            boolean typedWordValid) {
        if (suggestions != null && suggestions.size() > 0) {
            setCandidatesViewShown(true);
        } else if (isExtractViewShown()) {
Stop searching for code, let great code find you!  Add Codota to your java IDE