Code example for InputConnection

Methods: setComposingText

0
  } 
 
  private void updateComposingText(InputConnection ic) {
    if (ic != null) {
      // Set cursor position 1 to advance the cursor to the text end. 
      ic.setComposingText(composingText, 1);
    } 
  } 
 
  private boolean deleteLastComposingChar(InputConnection ic) {
    if (hasComposingText()) { 
      // Delete-key are accepted only when there's text in composing. 
      composingText.deleteCharAt(composingText.length() - 1);
      updateComposingText(ic);
      return true; 
    } 
    return false; 
  } 
 
  /** 
   * Commits the given text to the editing field.