Code example for KeyboardView

Methods: closing, setKeyboard

0
 
	@Override 
	public void onStartInputView(EditorInfo attribute, boolean restarting) {
		super.onStartInputView(attribute, restarting);
		// Apply the selected keyboard to the input view. 
		keyboardView.setKeyboard(qwertyKeyboard);
		keyboardView.closing();
	} 
 
	/** 
	 * Deal with the editor reporting movement of its cursor. 
	 */ 
	@Override 
	public void onUpdateSelection(int oldSelStart, int oldSelEnd, int newSelStart, int newSelEnd, int candidatesStart,
			int candidatesEnd) {
		super.onUpdateSelection(oldSelStart, oldSelEnd, newSelStart, newSelEnd, candidatesStart, candidatesEnd);
 
		// If the current selection in the text view changes, we should 
		// clear whatever candidate text we have. 
		if (mComposing.length() > 0 && (newSelStart != candidatesEnd || newSelEnd != candidatesEnd)) {
			mComposing.setLength(0);