Code example for InputConnection

Methods: beginBatchEdit, commitText, endBatchEdit

0
   */ 
  public boolean commitText(InputConnection ic, CharSequence text) {
    if (ic != null) {
      if (text.length() > 1) {
        // Batch edit a sequence of characters. 
        ic.beginBatchEdit();
        ic.commitText(text, 1);
        ic.endBatchEdit();
      } else { 
        ic.commitText(text, 1);
      } 
      // Composing-text in the editor has been cleared. 
      composingText.setLength(0);
      return true; 
    } 
    return false; 
  } 
 
  public boolean treatEnterAsLinkBreak() { 
    return enterAsLineBreak;
  }