Code example for InputMethodService

Methods: getCurrentInputConnection

0
            return; 
        } 
 
        String result = mLastRecognitionResult;
 
        InputConnection conn = mInputMethodService.getCurrentInputConnection();
 
        if (conn == null) {
            Log.i(TAG, "Unable to commit recognition result, as the current input connection "
                    + "is null. Did someone kill the IME?"); 
            return; 
        } 
 
        if (!conn.beginBatchEdit()) {
            Log.i(TAG, "Unable to commit recognition result, as a batch edit cannot start");
            return; 
        } 
 
        try { 
            ExtractedTextRequest etr = new ExtractedTextRequest();
            etr.flags = InputConnection.GET_TEXT_WITH_STYLES;